modules: system: nix: use stable 'NIX_PATH'
All checks were successful
continuous-integration/drone/push Build is passing
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:
parent
c1214547da
commit
6eb87c21b7
|
@ -17,6 +17,18 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
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 = {
|
nix = {
|
||||||
package = pkgs.nix;
|
package = pkgs.nix;
|
||||||
|
@ -60,11 +72,11 @@ in
|
||||||
|
|
||||||
(lib.mkIf cfg.addToNixPath {
|
(lib.mkIf cfg.addToNixPath {
|
||||||
nix.nixPath = [
|
nix.nixPath = [
|
||||||
"self=${inputs.self}"
|
"self=/etc/nix/inputs/self"
|
||||||
"pkgs=${inputs.nixpkgs}"
|
"pkgs=/etc/nix/inputs/nixpkgs"
|
||||||
"nur=${inputs.nur}"
|
"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;
|
++ options.nix.nixPath.default;
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue