Closed devins2518 closed 2 years ago
I found this issue https://github.com/nix-community/home-manager/issues/2004 which alluded to the fact that users.users.<username>.home
is set to /var/empty
by default, but doesn't seem to be set to the proper directory unless you define a user account. Is there any way to send out a warning or error message if there's no user accounts defined? I'll close the issue, but the examples or documentation should show that this issue will be caused if you don't set user accounts.
@devins2518 I think I've bumped into the same issue. Could you please provide some information about the way you managed to solve this? For me defining the home results in error https://github.com/FlakM/nix_dots/blob/bf3878f0471cdb78f170ae7461dfc52a1d517292/.nixpkgs/home-manager/pro.nix#L11
❯ darwin-rebuild switch --flake .
building the system configuration...
error: The option `home-manager.users.mflak.home.homeDirectory' has conflicting definition values:
- In `<unknown-file>': "/Users/mflak"
- In `/nix/store/4ibd0n5jnaznp0cjg86r7g0ql0l8hcpi-source/nixos/common.nix': "/var/empty"
(use '--show-trace' to show detailed location information)
As explained above, this is how I set up my home directory in a Darwin specific configuration file.
users = {
users = {
devin = {
shell = pkgs.zsh;
description = "Devin Singh";
home = "/Users/devin";
};
};
};
@FlakM I ran into this as well. I think you need to add
users.users.mflak = {
name = "mflak";
home = "/Users/mflak";
};
I'm not sure why my configuration was working before without it, but essentially your home-manager user and users.user need to match, IIUC.
I was having an issue with GPG where
$GNUPGHOME
was set to/var/empty/.gnupg
and caused all signing to fail since it couldn't read or write there. I attempted to fix this by adding this to my config:However, this didn't fix the issue.
$GNUPGHOME
was being set to/var/empty/.local/share/.gnupg
now. My fix is now this:This is obviously not ideal and not portable.
I suspect that this is an issue with nix-darwin as it hasn't happened with my NixOS system which doesn't require this fix.