modules: system: nix: use stable 'NIX_PATH'
All checks were successful
continuous-integration/drone/push Build is passing

Since the links are updated on system switch, NIX_PATH will
automatically point to the actual system version of the inputs at all
times
This commit is contained in:
Bruno BELANYI 2023-02-23 21:00:30 +00:00
parent c1214547da
commit 6eb87c21b7

View file

@ -17,6 +17,18 @@ in
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
assertions = [
{
assertion = cfg.addToNixPath -> cfg.linkInputs;
message = ''
enabling `my.system.nix.addToNixPath` needs to have
`my.system.nix.linkInputs = true`
'';
}
];
}
{
nix = {
package = pkgs.nix;
@ -60,11 +72,11 @@ in
(lib.mkIf cfg.addToNixPath {
nix.nixPath = [
"self=${inputs.self}"
"pkgs=${inputs.nixpkgs}"
"nur=${inputs.nur}"
"self=/etc/nix/inputs/self"
"pkgs=/etc/nix/inputs/nixpkgs"
"nur=/etc/nix/inputs/nur"
]
++ lib.optional cfg.overrideNixpkgs "nixpkgs=${inputs.nixpkgs}"
++ lib.optional cfg.overrideNixpkgs "nixpkgs=/etc/nix/inputs/nixpkgs"
++ options.nix.nixPath.default;
})
]);