Compare commits
No commits in common. "6eb87c21b7be926d7a09a3fa582fc0919b57339d" and "607d11bbad7d72f927fac74e98eb749c2c9ab2d1" have entirely different histories.
6eb87c21b7
...
607d11bbad
|
@ -7,8 +7,6 @@ in
|
|||
options.my.system.nix = with lib; {
|
||||
enable = my.mkDisableOption "nix configuration";
|
||||
|
||||
linkInputs = my.mkDisableOption "link inputs to `/etc/nix/inputs/`";
|
||||
|
||||
addToRegistry = my.mkDisableOption "add inputs and self to registry";
|
||||
|
||||
addToNixPath = my.mkDisableOption "add inputs and self to nix path";
|
||||
|
@ -17,18 +15,6 @@ 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;
|
||||
|
@ -52,31 +38,13 @@ in
|
|||
};
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.linkInputs {
|
||||
environment.etc =
|
||||
let
|
||||
makeLink = n: v: {
|
||||
name = "nix/inputs/${n}";
|
||||
value = { source = v.outPath; };
|
||||
};
|
||||
makeLinks = lib.mapAttrs' makeLink;
|
||||
in
|
||||
makeLinks {
|
||||
inherit (inputs)
|
||||
self
|
||||
nixpkgs
|
||||
nur
|
||||
;
|
||||
};
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.addToNixPath {
|
||||
nix.nixPath = [
|
||||
"self=/etc/nix/inputs/self"
|
||||
"pkgs=/etc/nix/inputs/nixpkgs"
|
||||
"nur=/etc/nix/inputs/nur"
|
||||
"self=${inputs.self}"
|
||||
"pkgs=${inputs.nixpkgs}"
|
||||
"nur=${inputs.nur}"
|
||||
]
|
||||
++ lib.optional cfg.overrideNixpkgs "nixpkgs=/etc/nix/inputs/nixpkgs"
|
||||
++ lib.optional cfg.overrideNixpkgs "nixpkgs=${inputs.nixpkgs}"
|
||||
++ options.nix.nixPath.default;
|
||||
})
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue