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 Answers 2


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?


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

  • Ok but how do I fix my current home directory? The group is users on all of the folders and that could be a security problem. Commented Mar 19, 2016 at 13:19
  • @JohnMercier chgrp --recursive johns /home/john/
    – Andrew
    Commented Mar 20, 2016 at 5:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .