Files
Foundry/hosts/nixos/common/global/nix.nix
T
2026-08-06 09:53:42 -03:00

42 lines
1.0 KiB
Nix

{
inputs,
lib,
...
}: let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
nix = {
settings = {
extra-substituters = lib.mkAfter ["https://cache.m7.rs"];
extra-trusted-public-keys = ["cache.m7.rs:kszZ/NSwE/TjhOcPPQ16IuUiuRSisdiIwhKZCxguaWg="];
trusted-users = [
"root"
"@wheel"
];
auto-optimise-store = lib.mkDefault true;
experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
];
warn-dirty = false;
system-features = [
"kvm"
"big-parallel"
"nixos-test"
];
flake-registry = ""; # Disable global flake registry
};
gc = {
automatic = true;
dates = "daily";
# Keep generations from the past week
options = "--delete-older-than 7d";
};
# Add each flake input as a registry and nix_path
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
}