Skip to content

Commit

Permalink
docs(nix): document home-manager activation error
Browse files Browse the repository at this point in the history
by default home-manager depend on files under ~/.nix-profile, which is
not ideal
  • Loading branch information
WilliamHsieh committed Dec 25, 2024
1 parent d9f1c17 commit 2ae8f11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
};

darwinConfigurations = mkSystem {
# NOTE: home manager activation is showing following error
# error: profile '/Users/william/.local/state/nix/profiles/profile' is incompatible with 'nix-env'; please use 'nix profile' instead
# temporary workaround is to synlink ~/.local/state/nix/profile to ~/.nix-profile
# ref: https://discourse.nixos.org/t/home-manager-insists-on-using-nix-profile/57708
isDarwin = true;
};

Expand Down
1 change: 1 addition & 0 deletions lib/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ in
auto-optimise-store = !pkgs.stdenv.isDarwin;

# add these to global /etc/nix/nix.conf when using home manager, and restart nix-daemon by `systemctl restart nix-daemon`
# nix-daemon doesn't watch the nix.conf file: https://github.com/NixOS/nix/issues/8939
trusted-users = [
"root"
"@wheel"
Expand Down

0 comments on commit 2ae8f11

Please sign in to comment.