Compare commits
2 commits
8dcc59d481
...
5bce2fafde
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 5bce2fafde | ||
Bruno BELANYI | 26bf4e3631 |
|
@ -10,6 +10,8 @@ in
|
||||||
addToRegistry = my.mkDisableOption "add inputs and self to registry";
|
addToRegistry = my.mkDisableOption "add inputs and self to registry";
|
||||||
|
|
||||||
addToNixPath = my.mkDisableOption "add inputs and self to nix path";
|
addToNixPath = my.mkDisableOption "add inputs and self to nix path";
|
||||||
|
|
||||||
|
overrideNixpkgs = my.mkDisableOption "point nixpkgs to pinned system version";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
|
@ -29,17 +31,21 @@ in
|
||||||
self.flake = inputs.self;
|
self.flake = inputs.self;
|
||||||
# Use pinned nixpkgs when using `nix run pkgs#<whatever>`
|
# Use pinned nixpkgs when using `nix run pkgs#<whatever>`
|
||||||
pkgs.flake = inputs.nixpkgs;
|
pkgs.flake = inputs.nixpkgs;
|
||||||
|
# ... And with `nix run nixpkgs#<whatever>`
|
||||||
|
nixpkgs.flake = lib.mkIf cfg.overrideNixpkgs inputs.nixpkgs;
|
||||||
# Add NUR to run some packages that are only present there
|
# Add NUR to run some packages that are only present there
|
||||||
nur.flake = inputs.nur;
|
nur.flake = inputs.nur;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(lib.mkIf cfg.addToNixPath {
|
(lib.mkIf cfg.addToNixPath {
|
||||||
nix.nixPath = options.nix.nixPath.default ++ [
|
nix.nixPath = [
|
||||||
"self=${inputs.self}"
|
"self=${inputs.self}"
|
||||||
"pkgs=${inputs.nixpkgs}"
|
"pkgs=${inputs.nixpkgs}"
|
||||||
"nur=${inputs.nur}"
|
"nur=${inputs.nur}"
|
||||||
];
|
]
|
||||||
|
++ lib.optional cfg.overrideNixpkgs "nixpkgs=${inputs.nixpkgs}"
|
||||||
|
++ options.nix.nixPath.default;
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue