modules/system/flake-qol: double copying nixpkgs is no more
This commit is contained in:
parent
2ff9d98635
commit
a7e14fb69a
1 changed files with 20 additions and 2 deletions
|
@ -7,6 +7,18 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.settei.flake-qol;
|
cfg = config.settei.flake-qol;
|
||||||
|
|
||||||
|
nixpkgsInputToFlakeRef =
|
||||||
|
input:
|
||||||
|
if input._type or "" == "flake" then
|
||||||
|
{
|
||||||
|
type = "github";
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
inherit (input) lastModified narHash rev;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
input;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
_file = ./flake-qol.nix;
|
_file = ./flake-qol.nix;
|
||||||
|
@ -20,6 +32,12 @@ in
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
inputs = mkOption { type = types.unspecified; };
|
inputs = mkOption { type = types.unspecified; };
|
||||||
|
nixpkgsRef = mkOption {
|
||||||
|
type = types.unspecified;
|
||||||
|
default = cfg.inputs.nixpkgs;
|
||||||
|
apply =
|
||||||
|
ref: if builtins.isString ref then builtins.parseFlakeRef ref else nixpkgsInputToFlakeRef ref;
|
||||||
|
};
|
||||||
inputs-flakes = mkOption {
|
inputs-flakes = mkOption {
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
|
@ -44,8 +62,8 @@ in
|
||||||
settei.user.extraArgs = reexportedArgs;
|
settei.user.extraArgs = reexportedArgs;
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
registry = lib.mapAttrs (_: flake: { inherit flake; }) cfg.inputs-flakes;
|
registry.nixpkgs.to = cfg.nixpkgsRef;
|
||||||
nixPath = lib.mapAttrsToList (name: _: "${name}=flake:${name}") cfg.inputs-flakes;
|
nixPath = [ "nixpkgs=flake:nixpkgs" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue