nix-config/hosts/common/global/nix.nix
2024-12-02 14:21:42 +01:00

28 lines
764 B
Nix

{
inputs,
lib,
...
}: {
nix = {
settings = {
auto-optimise-store = lib.mkDefault true;
experimental-features = ["nix-command" "flakes"];
warn-dirty = false;
system-features = ["kvm" "big-parallel" "nixos-test"];
};
gc = {
automatic = true;
dates = "weekly";
# Keep the last 3 generations
options = "--delete-older-than +3";
};
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
# Add nixpkgs input to NIX_PATH
# This lets nix2 commands still use <nixpkgs>
nixPath = ["nixpkgs=${inputs.nixpkgs.outPath}"];
};
}