How to write files in my home?

I installed Nixos yesterday I tried to write a new file in my home but the write access is denied.
I used “sudo chown -R myname:users /home/myname myname” to make sure I own everything in my user home then I used Micro text editor and Howl with the same result. I also checked the current user with the “who” command.

Usually it should just work, what did you try to write the file?

I forgot an info

ls -l command show " -r-------- " permissions on almost all files in the home.
I have a bad understanding of what Linux owner can do.

That is definitely how it is expected to be, what did you do? How did you create the user?

The user is created in the “configuration.nix” Then I created its password in the first startup using “passwd myname” I can log in this user.

Then something is weird.

Where did you want to create the file, and what permissions and owners are on the folder where you wanted to create the file and what permissions and owner are on its parents?

I can tell my home was fully copied to my fresh Nixos from my previous linux distro. Maybe rsync set the permissions to -r------ .
I don’t remember the permissions of my user folder because I just “chowned” the permissions on the whole user directory to solve the problem !
I changed the permissions using “chown -R u=rwx, go=rx myname” (with root user of course) .
The problem is gone I hope it is safe, I try nixos for my personnal desktop.
The concept of owner confused me, in linux even owner is limited by permission, not like the real world .
Sorry for the very newbie question and thank you Nobbz.