however when i run sudo nixos-rebuild switch t gives errors:
[titus@nixos:~]$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1575:11:
1574| || pred here (elemAt values 1) (head values) then
1575| head values
| ^
1576| else
… while evaluating the attribute 'value'
at /nix/var/nix/profiles/per-user/root/channels/nixos/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 `services.displayManager.defaultSession' has conflicting definition values:
- In `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/services/x11/desktop-managers/pantheon.nix': "pantheon"
- In `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/services/desktop-managers/plasma6.nix': "plasma"
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
Ugh. Looks like it is worse nowadays. Previously, it was just the NIX_GSETTINGS_OVERRIDES_DIR variable, which I have on my to-do list to eventually remove in favour of using the new dconf module. Now it is also defaultSession, which DE modules should not really set and ssh-askpass.
As the error says, you can use lib.mkForce the resolve the conflict. You can choose a value from one of thementionedmodules.
For example, to use GSettings settings (NIX_GSETTINGS_OVERRIDES_DIR) from GNOME, copy the following and wrap the value with lib.mkForce:
In this case, it refers to some variables so you will need to copy them as well:
Yeah the issue of different desktop environments overiding configurations led me away from nixOS for a while but I heard its gotten better now so I reinstalled nixOS. Thank you for the solution I will now try it out
Hi @jtojnar Thank you so much!, I tried your solution and It was this close to working! One small issue after I nixos-rebuild switch your solution at the end of the output this error appears:
ln: failed to create symbolic link '/nix/store/9mkpxwnwf99yrir14q71x37r0kmggvpp-user-units/xdg-desktop-portal-gtk.service': File exists
error: builder for '/nix/store/08xh5qr3dgs6byrcmw7rzzx4mpk4i9qy-user-units.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/f5c0gj34zkw1fzi95yrvwpni3104x473-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/v3mirdj5r2dg00hsm1w27qzqxsxsfqi5-nixos-system-nixos-24.05.984.0b8e7a1ae5a9.drv' failed to build
Which I recall from my last crack at nixOS 3 months ago as being an issue that prevents any more generations of a system.