module(nix): Config flake inputs as nix registry

This commit is contained in:
ulic-youthlic 2025-07-10 20:54:10 +08:00
parent c8f57642db
commit 9317743571
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721

View file

@ -7,6 +7,12 @@
... ...
}: { }: {
config = { config = {
environment.etc =
inputs
|> lib.mapAttrs' (name: value:
lib.nameValuePair "nix/inputs/${name}" {
source = value;
});
nixpkgs = { nixpkgs = {
config = { config = {
allowUnfree = true; allowUnfree = true;
@ -23,7 +29,7 @@
mode = "0444"; mode = "0444";
}; };
nix = { nix = {
nixPath = ["nixpkgs=${inputs.nixpkgs}"]; nixPath = ["/etc/nix/inputs"];
extraOptions = '' extraOptions = ''
!include ${config.sops.secrets."access-tokens".path} !include ${config.sops.secrets."access-tokens".path}
''; '';
@ -54,13 +60,14 @@
builders-use-substitutes = true; builders-use-substitutes = true;
}; };
package = pkgs.nix; package = pkgs.nix;
registry.sys = lib.mkDefault { registry =
from = { inputs
type = "indirect"; |> lib.filterAttrs (name: _value: name != "nixpkgs")
id = "sys"; |> lib.mapAttrs (_name: value: {
}; flake = lib.mkForce {
flake = inputs.nixpkgs; outPath = value;
}; };
});
}; };
}; };
} }