From da04b1c6dd13af0dbada0d77ff195ab5e99eed5e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 17 May 2024 16:08:52 +0200 Subject: system/nix: set OS-agnostic nix options in common module --- system/settings/configuration/nix-linux.nix | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 system/settings/configuration/nix-linux.nix (limited to 'system/settings/configuration/nix-linux.nix') diff --git a/system/settings/configuration/nix-linux.nix b/system/settings/configuration/nix-linux.nix new file mode 100644 index 00000000..3b32ebd5 --- /dev/null +++ b/system/settings/configuration/nix-linux.nix @@ -0,0 +1,32 @@ +{ config +, lib +, pkgs +, ... +}: { + imports = [ + ./nix.nix + ]; + + nix = { + settings = { + auto-optimise-store = true; + + daemonCPUSchedPolicy = "idle"; + daemonIOSchedClass = "idle"; + }; + }; + + nixpkgs.config.allowUnfree = true; + + system.autoUpgrade = { + enable = true; + flags = [ "--max-jobs" "2" ]; + flake = "/home/alan/projects/alanpearce/nixfiles"; + }; + systemd.services.nixos-upgrade = { + script = pkgs.lib.mkForce '' + ${pkgs.nix}/bin/nix-channel --update + ${config.system.build.nixos-rebuild}/bin/nixos-rebuild boot --no-build-output ${toString config.system.autoUpgrade.flags} + ''; + }; +} -- cgit 1.4.1