You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short Version: I'm trying to setup nix/nix-darwin/home-manager/flakes for the first time. Every time I try to build my config for the first time, I get the error:
error: A definition for option `home-manager.users.jclark.home.homeDirectory' is not of type `path'. Definition values:
- In `/nix/store/1gkcml61pcjwxsmlkchr2wpivl0n4mhh-source/nixos/common.nix': null
Based on the specific error referencing home-manager.users... I assume this is a home-manager issue, but please let me know if this should be a nix-darwin issue instead.
Details
In a fresh Mac OS Sonoma 10.7 install, I installed Nix: sh <(curl -L https://nixos.org/nix/install)
I have created a minimal flake (shown below) in ~/dev/system-config.
Per the nix-darwin README, I tried to "install nix-darwin" via flake: nix --extra-experimental-features "nix-command flakes" run nix-darwin -- switch --flake ~/dev/system-config.
This results in the following error:
building the system configuration...
warning: Git tree '/Users/jclark/dev/system-config' is dirty
error:
… while evaluating the attribute 'value'
at /nix/store/0z5aw6jjbjq9sqcd03gfa7zkk25nzwgc-source/lib/modules.nix:816:9:
815| in warnDeprecation opt //
816| { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
817| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build':
… while evaluating the attribute 'mergedValue'
at /nix/store/0z5aw6jjbjq9sqcd03gfa7zkk25nzwgc-source/lib/modules.nix:851:5:
850| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
851| mergedValue =
| ^
852| if isDefined then
… while evaluating definitions from `/nix/store/95qf9prv27r48w7by4zlp38y1zkf8q3k-source/modules/system':
… while evaluating the option `home-manager.users.jclark.home.homeDirectory':
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: A definition for option `home-manager.users.jclark.home.homeDirectory' is not of type `path'. Definition values:
- In `/nix/store/1gkcml61pcjwxsmlkchr2wpivl0n4mhh-source/nixos/common.nix': null
My current ~/dev/system-config/flake.nix appears below. A few notes:
The machine name charybdis and user name jclark are correct for the machine.
I have removed a lot of my initial content to reduce the chance I had made a mistake with optional packages/settings
I chose the stateVersions listed based on a tutorial video I used to learn nix
None of the examples or tutorials I have looked at actually use home.homeDirectory, so I didn't have it my flake. Once I got the error, I tried setting it two different ways; see the two commented lines near the end of the file. Uncommenting either line makes no difference to the error message I receive.
Oh, that seems to be because you are using the nested structure for home-manager function argument. I guess in this case it should look like:
inputs.home-manager.darwinModules.home-manager{users.users.jclark.home="/Users/jclark";home-manager={useGlobalPkgs=true;useUserPackages=true;#... further stuff
Sorry about the mistake in my previous comment. I'm still a rookie in nix, so I didn't spot that difference at first glance. Hope this one will work 🤞
Thanks @frankiewiczkamil, this solved my issue as well. I wonder if the docs should be updated as the minimal example in the documentation does not include this and I couldn't get it to work without it. But I am very new to nix, so I am not sure if I am not doing something else wrong.
It seems redundant to me to both have to specify: users.users.bram.home = "/Users/bram"; in flake.nix and home.homeDirectory = "/Users/bram"; in home.nix
Are you following the right branch?
Is there an existing issue for this?
Issue description
Short Version: I'm trying to setup nix/nix-darwin/home-manager/flakes for the first time. Every time I try to build my config for the first time, I get the error:
Based on the specific error referencing
home-manager.users...
I assume this is a home-manager issue, but please let me know if this should be a nix-darwin issue instead.Details
sh <(curl -L https://nixos.org/nix/install)
~/dev/system-config
.nix --extra-experimental-features "nix-command flakes" run nix-darwin -- switch --flake ~/dev/system-config
.This results in the following error:
My current
~/dev/system-config/flake.nix
appears below. A few notes:charybdis
and user namejclark
are correct for the machine.stateVersions
listed based on a tutorial video I used to learn nixhome.homeDirectory
, so I didn't have it my flake. Once I got the error, I tried setting it two different ways; see the two commented lines near the end of the file. Uncommenting either line makes no difference to the error message I receive.Maintainer CC
No response
System information
The text was updated successfully, but these errors were encountered: