Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home Directory is not Created for the New User #984

Open
rennsax opened this issue Jun 24, 2024 · 1 comment
Open

Home Directory is not Created for the New User #984

rennsax opened this issue Jun 24, 2024 · 1 comment

Comments

@rennsax
Copy link

rennsax commented Jun 24, 2024

nix-darwin uses createhomedir(1) to create the user's home directory when createHome is set to true (check here). However, createhomedir(1) somehow does not create the home directory.

Is this behavior by design? Or do I misunderstand createhomedir(1)?

To reproduce, add this piece of attribute set to the modules:

{
  users.users = {
    nix-user = {
      name = "nix-user";
      uid = 502;
      isHidden = true;
      description = "nix-user";
      shell = pkgs.bashInteractive;
      home = "/home/nix-user";
      createHome = true;
    };
  };
  users.forceRecreate = true; # always recreate, otherwise createhomedir won't be run
  users.knownUsers = [ "nix-user" ];
}

After darwin-rebuild switch I can sudo su nix-user, but the home directory of nix-user (/home/nix-user) is not created.

@rennsax
Copy link
Author

rennsax commented Jun 27, 2024

Additionally, I find that declare users.users.<name>.shell for an existing user won't change the user shell. Maybe it's a little bit unreasonable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant