Add shared modules for nix-gc and nix-settings

This commit is contained in:
2026-03-27 13:13:08 +00:00
commit cedeb8cccb
3 changed files with 32 additions and 0 deletions

10
flake.nix Normal file
View File

@@ -0,0 +1,10 @@
{
description = "Shared Nix settings (NixOS, Home Manager etc)";
outputs = { self }: {
nixosModules = {
nix-settings = import ./modules/nix-settings.nix;
nix-gc = import ./modules/nix-gc.nix;
};
};
}

7
modules/nix-gc.nix Normal file
View File

@@ -0,0 +1,7 @@
_: {
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 60d";
};
}

15
modules/nix-settings.nix Normal file
View File

@@ -0,0 +1,15 @@
_: {
nix.settings = {
extra-experimental-features = [
"nix-command"
"flakes"
];
auto-optimise-store = true;
trusted-users = [ "@wheel" ];
# RPi builds can be slow due to compiling via binfmt.
download-buffer-size = 1 * 1024 * 1024 * 1024;
};
}