building the system configuration...
error:
… while calling the 'head' builtin
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/attrsets.nix:960:11:
959| || pred here (elemAt values 1) (head values) then
960| head values
| ^
961| else
… while evaluating the attribute 'value'
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: syntax error, unexpected ID, expecting '}'
at /nix/store/9ginqzv6dbjhkga5d23skczw3n143ah9-source/home.nix:11:3:
10| ... # Your zsh config
11| enable = true;
| ^
12| shellAliases = {
Given that this line appears in the error message literally, they did not remove it.
@shmu26, please remove the line, the ... has a certain meaning in a certain context, and it always have to be the last thing in a set pattern, thats why you get an error here.
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/attrsets.nix:960:11:
959| || pred here (elemAt values 1) (head values) then
960| head values
| ^
961| else
… while evaluating the attribute 'value'
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: syntax error, unexpected ';', expecting end of file
at /nix/store/1xpd4jv46gnaz0yhml02gd90k2apa675-source/home.nix:22:3:
21| };
22| };
| ^
23| }
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/attrsets.nix:960:11:
959| || pred here (elemAt values 1) (head values) then
960| head values
| ^
961| else
… while evaluating the attribute 'value'
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `home-manager.users.shmuel.oh-my-zsh' does not exist. Definition values:
- In `/nix/store/4b797c6c48qkwf2lkzs01h3i1d7189sq-source/flake.nix':
{
enable = true;
plugins = [ ];
theme = "agnoster";
}
I am obviously not seeing the obvious.
Before, I had oh-my-zsh = {
Now I changed it to programs.oh-my-zsh = {
But I get
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/attrsets.nix:960:11:
959| || pred here (elemAt values 1) (head values) then
960| head values
| ^
961| else
… while evaluating the attribute 'value'
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `home-manager.users.shmuel.programs.oh-my-zsh' does not exist. Definition values:
- In `/nix/store/ja59753nvfi4lx346srh8xqyg9y2f0qv-source/flake.nix':
{
enable = true;
plugins = [ ];
theme = "agnoster";
}
Yes that should’ve fixed it but I suspect that you have it in the wrong place.
From what I can see it is now in the flake.nix file.
If you move it back to the home.nix it should work.
It’s a good advice in general when you’re trying to solve a problem.
Only ever change one thing at a time, otherwise you don’t know what exactly made it work in the end.
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/attrsets.nix:960:11:
959| || pred here (elemAt values 1) (head values) then
960| head values
| ^
961| else
… while evaluating the attribute 'value'
at /nix/store/bg5fbkfa5x53clcjf4p5p92k1l3w8x38-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `home-manager.users.shmuel.programs.oh-my-zsh' does not exist. Definition values:
- In `/nix/store/ja59753nvfi4lx346srh8xqyg9y2f0qv-source/flake.nix':
{
enable = true;
plugins = [ ];
theme = "agnoster";
}
The error is referencing flake.nix, but the code snippet that it quotes is in fact in home.nix. This is puzzling.
Both produce what looks like the same error. I will try to look up the logs.
building the system configuration...
activating the configuration...
setting up /etc...
reloading user units for shmuel...
restarting sysinit-reactivation.target
warning: the following units failed: home-manager-shmuel.service
× home-manager-shmuel.service - Home Manager environment for shmuel
Loaded: loaded (/etc/systemd/system/home-manager-shmuel.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Mon 2024-02-19 22:21:16 IST; 89ms ago
Duration: 2h 11min 12.162s
Process: 76672 ExecStart=/nix/store/xqfi0hbdgf674hhlw9l2m5bbpd82ysql-hm-setup-env /nix/store/i9dpq3jq5ml6lymihxmnvhwp5g57g1s4-home-manager-generation (code=exited, status=1/FAILURE)
Main PID: 76672 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 71ms
Feb 19 22:21:16 nixos systemd[1]: Starting Home Manager environment for shmuel...
Feb 19 22:21:16 nixos hm-activate-shmuel[76672]: Starting Home Manager activation
Feb 19 22:21:16 nixos hm-activate-shmuel[76672]: Activating checkFilesChanged
Feb 19 22:21:16 nixos hm-activate-shmuel[76672]: Activating checkLinkTargets
Feb 19 22:21:16 nixos hm-activate-shmuel[76761]: Existing file '/home/shmuel/.zshrc' is in the way of '/nix/store/gh5yzl95z2mhp9nwxr060h86nmj9xyq0-home-manager-files/.zshrc'
Feb 19 22:21:16 nixos hm-activate-shmuel[76761]: Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically.
Feb 19 22:21:16 nixos systemd[1]: home-manager-shmuel.service: Main process exited, code=exited, status=1/FAILURE
Feb 19 22:21:16 nixos systemd[1]: home-manager-shmuel.service: Failed with result 'exit-code'.
Feb 19 22:21:16 nixos systemd[1]: Failed to start Home Manager environment for shmuel.
warning: error(s) occurred while switching to the new configuration
shmuel@nixos:~/nixos/ >
Home-manager doesn’t overwrite files.
Probably your old config is still there?
You can move it to another place and then it should work. mv /home/shmuel/.zshrc ~/Downloads/zshrc
systemctl status home-manager-shmuel.service
× home-manager-shmuel.service - Home Manager environment for shmuel
Loaded: loaded (/etc/systemd/system/home-manager-shmuel.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Mon 2024-02-19 22:21:16 IST; 2min 29s ago
Duration: 2h 11min 12.162s
Process: 76672 ExecStart=/nix/store/xqfi0hbdgf674hhlw9l2m5bbpd82ysql-hm-setup-env /nix/store/>
Main PID: 76672 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 71ms
Feb 19 22:21:16 nixos systemd[1]: Starting Home Manager environment for shmuel...
Feb 19 22:21:16 nixos hm-activate-shmuel[76672]: Starting Home Manager activation
Feb 19 22:21:16 nixos hm-activate-shmuel[76672]: Activating checkFilesChanged
Feb 19 22:21:16 nixos hm-activate-shmuel[76672]: Activating checkLinkTargets
Feb 19 22:21:16 nixos hm-activate-shmuel[76761]: Existing file '/home/shmuel/.zshrc' is in the wa>
Feb 19 22:21:16 nixos hm-activate-shmuel[76761]: Please move the above files and try again or use>
Feb 19 22:21:16 nixos systemd[1]: home-manager-shmuel.service: Main process exited, code=exited, >
Feb 19 22:21:16 nixos systemd[1]: home-manager-shmuel.service: Failed with result 'exit-code'.
Feb 19 22:21:16 nixos systemd[1]: Failed to start Home Manager environment for shmuel.
lines 1-18/18 (END)
journalctl -xeu home-manager-shmuel.service
Feb 19 22:21:16 nixos hm-activate-shmuel[76672]: Activating checkLinkTargets
Feb 19 22:21:16 nixos hm-activate-shmuel[76761]: Existing file '/home/shmuel/.zshrc' is in the wa>
Feb 19 22:21:16 nixos hm-activate-shmuel[76761]: Please move the above files and try again or use>
Feb 19 22:21:16 nixos systemd[1]: home-manager-shmuel.service: Main process exited, code=exited, >
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit home-manager-shmuel.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Feb 19 22:21:16 nixos systemd[1]: home-manager-shmuel.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit home-manager-shmuel.service has entered the 'failed' state with result 'exit-code'.
Feb 19 22:21:16 nixos systemd[1]: Failed to start Home Manager environment for shmuel.
░░ Subject: A start job for unit home-manager-shmuel.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit home-manager-shmuel.service has finished with a failure.
░░
░░ The job identifier is 33226 and the job result is failed.
lines 129-153/153 (END)
You’re welcome, glad we got it working
It takes some time to getting used to this work flow.
The great thing is that when it builds it usually works and you have a known good state you can revert to.
Even if you use generations you can always use git to revert to a previous state and built it.
Just be aware that applications that use a database sometimes don’t like it when you revert.
E.g. Signal has a database and it isn’t downwards compatible so you’re either stuck with the new package or remove the database before reverting to the older version.