Files
nixos-config/modules/system/nix.nix
T
2026-03-19 17:55:09 +01:00

32 lines
840 B
Nix

{ config, lib, pkgs, modulesPath, ... }:
let
keepGenerations = if config.boot.lanzaboote.enable then
config.boot.lanzaboote.configurationLimit
else if config.boot.loader.systemd-boot.enable then
config.boot.loader.systemd-boot.configurationLimit
else null;
in
{
nix = {
daemonIOSchedClass = "idle";
daemonCPUSchedPolicy = "idle";
settings.trusted-users = [ "root" "user" ];
};
# Clean up nix store from old configurations usinx nix-sweep
services.nix-sweep = {
enable = true;
# Automatically determine configuration limit from bootloader
keepMax = keepGenerations;
keepMin = if keepGenerations != null then keepGenerations else 10;
gc = true; # Run GC afterwards
};
services.peerix = {
enable = true;
trackerUrl = null; # Use LAN mode instead of Iroh
};
}