nixos-configuration/modules/nix.nix
2025-04-09 10:20:44 +02:00

56 lines
1.2 KiB
Nix

{ lib, pkgs, inputs, system, ... }:
{
nix = {
daemonCPUSchedPolicy = "idle";
daemonIOSchedClass = "idle";
daemonIOSchedPriority = 7;
nixPath = [
"nixpkgs=${inputs.nixpkgs}"
];
settings = {
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [ "@wheel" ];
auto-optimise-store = true;
allowed-users = [ "@wheel" ];
log-lines = lib.mkDefault 25;
# Avoid disk full issues
max-free = lib.mkDefault (3000 * 1024 * 1024);
min-free = lib.mkDefault (512 * 1024 * 10);
download-buffer-size = lib.mkDefault (512 * 1024 * 1024);
};
gc = {
automatic = true;
options = "--delete-older-than 30d";
randomizedDelaySec = "60 min";
};
};
systemd.services.nix-daemon.serviceConfig.OOMScoreAdjust = 250;
nixpkgs.config.permittedInsecurePackages = [
"olm-3.2.16"
];
nixpkgs.overlays = [
inputs.self.overlays.default
(final: prev: {
master = import inputs.nixpkgsMaster {
inherit system;
config = prev.config;
};
})
];
environment.systemPackages = with pkgs; [
cached-nix-shell
];
}