Compare commits

..

No commits in common. "6eb87c21b7be926d7a09a3fa582fc0919b57339d" and "607d11bbad7d72f927fac74e98eb749c2c9ab2d1" have entirely different histories.

View file

@ -7,8 +7,6 @@ in
options.my.system.nix = with lib; { options.my.system.nix = with lib; {
enable = my.mkDisableOption "nix configuration"; enable = my.mkDisableOption "nix configuration";
linkInputs = my.mkDisableOption "link inputs to `/etc/nix/inputs/`";
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";
@ -17,18 +15,6 @@ 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;
@ -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 { (lib.mkIf cfg.addToNixPath {
nix.nixPath = [ nix.nixPath = [
"self=/etc/nix/inputs/self" "self=${inputs.self}"
"pkgs=/etc/nix/inputs/nixpkgs" "pkgs=${inputs.nixpkgs}"
"nur=/etc/nix/inputs/nur" "nur=${inputs.nur}"
] ]
++ lib.optional cfg.overrideNixpkgs "nixpkgs=/etc/nix/inputs/nixpkgs" ++ lib.optional cfg.overrideNixpkgs "nixpkgs=${inputs.nixpkgs}"
++ options.nix.nixPath.default; ++ options.nix.nixPath.default;
}) })
]); ]);