diff options
| author | seth <[email protected]> | 2023-09-01 17:15:15 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-09-01 17:20:46 -0400 |
| commit | 667b3855f2bd634809d44c534d260d70447d4fbb (patch) | |
| tree | d2f88585f55627806ac13a0587df97dac6a16023 /templates/nixos/modules/basic.nix | |
| parent | f7d4a40bc5a370c8fa77188f04e8c68cbc2e1f4a (diff) | |
templates/nixos: add nix.registry options
Diffstat (limited to 'templates/nixos/modules/basic.nix')
| -rw-r--r-- | templates/nixos/modules/basic.nix | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/templates/nixos/modules/basic.nix b/templates/nixos/modules/basic.nix index c1b5ebc..f1f7a81 100644 --- a/templates/nixos/modules/basic.nix +++ b/templates/nixos/modules/basic.nix @@ -5,7 +5,7 @@ ... }: let inherit (builtins) attrNames map; - inherit (lib) mkDefault mkEnableOption mkIf mkOption types; + inherit (lib) filterAttrs mapAttrs mkDefault mkEnableOption mkIf mkOption types; cfg = config.getchoo.basicConfig; mapInputs = fn: map fn (attrNames inputs); @@ -28,15 +28,20 @@ in { nix = { gc = { automatic = mkDefault true; - options = mkDefault "-d --delete-older-then 2d"; + options = mkDefault "-d --delete-older-than 2d"; }; + nixPath = mapInputs (i: "${i}=${cfg.channelPath.dirname i}"); + + registry = + {n.flake = inputs.nixpkgs;} + // (mapAttrs (_: flake: {inherit flake;}) + (filterAttrs (n: _: n != "nixpkgs") inputs)); + settings = { auto-optimise-store = true; experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"]; }; - - nixPath = mapInputs (i: "${i}=${cfg.channelPath.dirname i}"); }; systemd.tmpfiles.rules = mapInputs (i: "L+ ${cfg.channelPath i} - - - - ${inputs.${i}.outPath}"); |
