nix-config/hosts/common/global/nix.nix

29 lines
764 B
Nix
Raw Normal View History

2023-12-24 11:16:59 +01:00
{
inputs,
lib,
...
}: {
nix = {
settings = {
auto-optimise-store = lib.mkDefault true;
2024-12-02 14:20:49 +01:00
experimental-features = ["nix-command" "flakes"];
2023-12-24 11:16:59 +01:00
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}"];
};
}