diff --git a/modules/system/nix/default.nix b/modules/system/nix/default.nix index 463c0f5..f8e7c24 100644 --- a/modules/system/nix/default.nix +++ b/modules/system/nix/default.nix @@ -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; }) ]);