Compare commits

..

No commits in common. "5bce2fafde5c01923fb1c4d45d25c24f77797a7a" and "8dcc59d4819ec8ca2d26e7984ceb9437419e85d4" have entirely different histories.

View file

@ -10,8 +10,6 @@ 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 [
@ -31,21 +29,17 @@ 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 = [ nix.nixPath = options.nix.nixPath.default ++ [
"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;
}) })
]); ]);
} }