4

This is my current users expression

   users.users = {
     john = {
       name = "john";
       group = "users";
       extraGroups = [
         "wheel" "disk" "audio" "video" "networkmanager" "systemd-journal"
       ];
       isNormalUser = true;
       uid = 1000;
       home = "/home/john";
       createHome = true;
     };
   };

My problem is that group = "users"; allows all users to see my files. How can I make the group = "john"; and clean up permissions on all of my files in the home directory? Is it possible to do this in my configuration.nix file? Also would restarting in one of these bad configurations mess up permissions again? How do I remove these old configurations so they cannot be accessed?

2 Answers2

1

To have own group, add users.groups.johns = { name = "John's"; members = ["john"]; gid = 1666 };. See also man configuration.nix for all the options.

Andrew
  • 397
1

You don't have to change group to accomplish what you want.

[danbst@station:~]$ ls -l /home
total 12
drwx------ 47 danbst users 12288 Jan 31 13:43 danbst

I am in users group, but my /home/danbst is accessible only by me. See more about executuable bit on directories in Execute vs Read bit. How do directory permissions in Linux work?

danbst
  • 533