idiosyn/modules/nix.nix
2024-07-23 16:56:52 +02:00

39 lines
1.1 KiB
Nix

{ lib, pkgs, ... }: {
config = {
nix = {
channel.enable = lib.mkDefault false;
daemonCPUSchedPolicy = lib.mkDefault "batch";
daemonIOSchedClass = lib.mkDefault "best-effort";
daemonIOSchedPriority = lib.mkDefault 7;
gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
randomizedDelaySec = lib.mkDefault "24h";
options = lib.mkDefault "--delete-older-than 14d";
};
settings = {
experimental-features = lib.mkDefault [
"cgroups"
"nix-command"
"flakes"
"repl-flake"
];
allowed-users = lib.mkDefault [ "@users" ];
trusted-users = lib.mkDefault [ "@wheel" ];
builders-use-substitutes = lib.mkDefault true;
download-attempts = lib.mkDefault 8;
http-connections = lib.mkDefault 128;
max-substitution-jobs = lib.mkDefault 128;
preallocate-contents = lib.mkDefault true;
use-cgroups = lib.mkIf pkgs.stdenv.hostPlatform.isLinux (lib.mkDefault true);
use-xdg-base-directories = lib.mkDefault true;
};
};
};
}