Closed srid closed 2 months ago
(2) is possible with nix-darwin, but not straightforward with home-manager.
It seems the issue arises from DetSys
using the latest nix
package, while nix-dev-home
is on the stable version, which lacks support for the new configuration variables. To resolve this, switching to the unstable
branch and keeping the flake updated as DetSys
's Nix package evolves should work.
However, it raises the question: why use the DetSys
installer for Nix if Home Manager is already installing Nix? If DetSys
is essential, setting nix.package = null
in Home Manager ensures it uses the system-wide Nix package.
Currently, both Nix packages—one from DetSys
(system-level) and one from Home Manager (user-level)—coexist, and the PATH order determines which one takes precedence. Ideally, there should be only one Nix package, and if it's from DetSys
, you can safely set nix.package = null
in Home Manager to avoid conflicts.
Yes, that's probably what we should do. However, I believe it was already like that before (isn't null the default value here?) when we had those warnings (#77).
Also, relevant: https://github.com/DeterminateSystems/nix-installer/issues/1165
But since home-manager cannot manage /etc/nix/nix.conf
we probably should give up control of Nix version and let DetSys manage that ...
(Unless using nix-darwin, because that manage /etc/nix/nix.conf
)
Yes, that's probably what we should do. However, I believe it was already like that before (isn't null the default value here?) when we had those warnings (#77).
Yep, The default value is null
.
The diff you mentioned in https://github.com/juspay/nix-dev-home/issues/77#issuecomment-2347123240 shows that the value before was pkgs.nix
.
The state of the repo at sept 10
is https://github.com/juspay/nix-dev-home/blob/138a8151e60304a70c341791a8f6cb6d1aefd390/nix/modules/home/nix.nix stating that home manager having package value pkgs.nix
But since home-manager cannot manage
/etc/nix/nix.conf
we probably should give up control of Nix version and let DetSys manage that ...(Unless using nix-darwin, because that manage
/etc/nix/nix.conf
)
yep, nixos/nix-darwin
are the only ways to get root control, and iirc there is something like nixos on wsl.
with the respect of this project nix
package should be managed by DetSys.
I was referring to this change on aug 8
https://github.com/juspay/nix-dev-home/commit/803cdc304cbd0df45d7b34f42813295026210b12
ig reverting 803cdc3 should fix then (if the issue is caused by version mismatch)
And potentially revert
But all of this was added as an attempt to fix these warnings in the first place! So this needs some testing.
See https://github.com/nix-community/home-manager/pull/5773
So upstream nix-direnv
uses pkgs.nix
: https://github.com/NixOS/nixpkgs/blob/eb28b94bd14835836b539bc3854a6abf929876d4/pkgs/by-name/ni/nix-direnv/package.nix#L51 - and this conflicts with what DetSys installs, which is why we have #84
How do solve this so that nix-direnv uses whatever DetSys installs?
Hmm, I see it uses "ambient Nix" and fallsback to pkgs.nix
only when it not in PATH.
Okay, I'll revert those changes and see what happens. This time let's thoroughly solve this if it reoccurs.
af55a164bb75692e75c90878d9030af736e1ed82
This time let's thoroughly solve this if it reoccurs.
git bisect should help to figure out after which commit the issue popped up.
nix-darwin has the same issue, btw:
Based on the discussion in LnL7/nix-darwin#931, it appears that NixOS manages its own Nix package, which is maintained through the NixOS configuration. However, on non-NixOS systems, such as other Linux distributions and macOS, issues arise due to inconsistent Nix installations. For instance, nix-darwin
and DetSys
may install different versions, leading to conflicts. To ensure consistency, it is essential for tools like nix-darwin
and DetSys
to check for existing Nix installations and guide users to either remove them or verify compatibility with the installed version.
https://github.com/juspay/nix-dev-home/discussions/85
ig it should be discuused here.
Currently using latest: https://github.com/juspay/nix-dev-home/commit/b65f5b459d1bb9c2db9d8604c516e5293b5c581d
But we should use
pkgs.nix
. When doing this, ensure that it:$PATH
)/etc/nix/nix.conf
is in sync with effective Nix, so as to avoid #77