diff --git a/flake.lock b/flake.lock index 4ef6807..ccc75ee 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ ] }, "locked": { - "lastModified": 1690228878, - "narHash": "sha256-9Xe7JV0krp4RJC9W9W9WutZVlw6BlHTFMiUP/k48LQY=", + "lastModified": 1684153753, + "narHash": "sha256-PVbWt3qrjYAK+T5KplFcO+h7aZWfEj1UtyoKlvcDxh0=", "owner": "ryantm", "repo": "agenix", - "rev": "d8c973fd228949736dedf61b7f8cc1ece3236792", + "rev": "db5637d10f797bb251b94ef9040b237f4702cde3", "type": "github" }, "original": { @@ -32,11 +32,11 @@ "stable": "stable" }, "locked": { - "lastModified": 1688224393, - "narHash": "sha256-rsAvFNhRFzTF7qyb6WprLFghJnRxMFjvD2e5/dqMp4I=", + "lastModified": 1685163780, + "narHash": "sha256-tMwseHtEFDpO3WKeZKWqrKRAZI6TiEULidxEbzicuFg=", "owner": "zhaofengli", "repo": "colmena", - "rev": "19384f3ee2058c56021e4465a3ec57e84a47d8dd", + "rev": "c61bebae1dc1d57237577080b1ca1e37a3fbcebf", "type": "github" }, "original": { @@ -74,11 +74,11 @@ ] }, "locked": { - "lastModified": 1690739034, - "narHash": "sha256-roW02IaiQ3gnEEDMCDWL5YyN+C4nBf/te6vfL7rG0jk=", + "lastModified": 1685970051, + "narHash": "sha256-F5ZxBD2DeNd+Q0dDKYBhv76kfjVG/X0ccXjSKpa8KdI=", "owner": "nix-community", "repo": "disko", - "rev": "4015740375676402a2ee6adebc3c30ea625b9a94", + "rev": "29d632d7e8fa86f937153ecdfd7d768411001d2d", "type": "github" }, "original": { @@ -110,11 +110,11 @@ ] }, "locked": { - "lastModified": 1690933134, - "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", + "lastModified": 1685662779, + "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", + "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", "type": "github" }, "original": { @@ -147,11 +147,11 @@ "flake-registry": { "flake": false, "locked": { - "lastModified": 1689333397, - "narHash": "sha256-g1Nn0sgH/hR/gEAQ1q6bloU+Q+V+Y4HlBBH6CBxC0HM=", + "lastModified": 1682423975, + "narHash": "sha256-zvOBrH3hwCedgpaWiOSHYSt+fgF/RhaJs8R5qOX6AYc=", "owner": "NixOS", "repo": "flake-registry", - "rev": "5d8dc3eb692809ffd9a2f22cdb8015aa11972905", + "rev": "8054bfa00d60437297d670ab3296a117e7059a10", "type": "github" }, "original": { @@ -219,11 +219,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1690957133, - "narHash": "sha256-0Y4CiOIszhHDDXHFmvHUpmhUotKOIn0m3jpMlm6zUTE=", + "lastModified": 1684899633, + "narHash": "sha256-NtwerXX8UFsoNy6k+DukJMriWtEjQtMU/Urbff2O2Dg=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "24f9162b26f0debd163f6d94752aa2acb9db395a", + "rev": "4cc688ee711159b9bcb5a367be44007934e1a49d", "type": "github" }, "original": { @@ -241,11 +241,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1688428885, + "lastModified": 1688319245, "narHash": "sha256-fVIbXKvHmxSUAKTMiXx799UasQwU2XT+op7bzvtfl8c=", "ref": "main", "rev": "9f32a304708fd9c91c081db05eee1b4f2e0226cc", - "revCount": 2, + "revCount": 5, "type": "git", "url": "ssh://gitea@git.newtype.fr/newtype/nixos-hypervisor" }, @@ -257,11 +257,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1691083802, - "narHash": "sha256-bjWTVGskCWR2BdB0Glnj2FyHooNiFThkFBF4oaAMe2s=", + "lastModified": 1685952468, + "narHash": "sha256-YCOr9kttCqoa9IZMjHxX6SlwenTg7FsSmG9TaT76mSE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "096c262bbb73d84b8298d81c7daa9890c6ccd6da", + "rev": "70f7275b32f49bc67ae3532b758b80cb6c27f98a", "type": "github" }, "original": { @@ -273,11 +273,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1691003216, - "narHash": "sha256-Qq/MPkhS12Bl0X060pPvX3v9ac3f2rRQfHjjozPh/Qs=", + "lastModified": 1685938391, + "narHash": "sha256-96Jw6TbWDLSopt5jqCW8w1Fc1cjQyZlhfBnJ3OZGpME=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4a56ce9727a0c5478a836a0d8a8f641c5b9a3d5f", + "rev": "31cd1b4afbaf0b1e81272ee9c31d1ab606503aed", "type": "github" }, "original": { @@ -289,11 +289,11 @@ }, "nur": { "locked": { - "lastModified": 1691109630, - "narHash": "sha256-NkltnE+ZMABNP7pJVj7ftu/58aTGa5PXxICLr8fjkI4=", + "lastModified": 1685980073, + "narHash": "sha256-7BkreZ2cH488dR1XPcdlALj+2g+NvrZdG9ZhwRt0YFI=", "owner": "nix-community", "repo": "NUR", - "rev": "dcd922e7738fc027c73cd2cc110015d38fba9651", + "rev": "de817406e39c1f9be28fde1d62c1f1f0c91acb09", "type": "github" }, "original": { @@ -325,11 +325,11 @@ ] }, "locked": { - "lastModified": 1690557184, - "narHash": "sha256-KMGPz3pP7OoUZaUhgcuYG84CtVaJOQw6RK8J0fAtKt0=", + "lastModified": 1685966850, + "narHash": "sha256-HaWNbihBIBATmSbuXLzA92C4858tNdS9Q5kRHJNagVo=", "owner": "numtide", "repo": "srvos", - "rev": "ceed433086a85e5540bd73cff46497af5a09e36f", + "rev": "4f22e6fcaf17c6313c2ecdc996760c3e4b14a623", "type": "github" }, "original": { @@ -379,3 +379,4 @@ "root": "root", "version": 7 } + diff --git a/modules/nix-daemon.nix b/modules/nix-daemon.nix index 760c768..ab3626e 100644 --- a/modules/nix-daemon.nix +++ b/modules/nix-daemon.nix @@ -1,7 +1,6 @@ { lib , config , pkgs -, inputs , ... }: @@ -30,17 +29,6 @@ in { domain = "*"; item = "nofile"; type = "-"; value = "20480"; } ]; - # Memory accounting techniques - systemd.services.nix-daemon.serviceConfig = { - MemoryAccounting = true; - MemoryMax = "225G"; - MemoryHigh = "220G"; - MemorySwapMax = "2G"; - ManagedOOMSwap = "kill"; - ManagedOOMMemoryPressure = "kill"; - MemoryPressureWatch = "on"; - }; - nix = { # Garbage-collect often gc.automatic = true; @@ -50,21 +38,23 @@ in # Randomize GC to avoid thundering herd effects. gc.randomizedDelaySec = "1800"; - # Inchallah, it works. - # package = lib.mkForce inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.nixVersions.nix_2_17; + # 2.11, 2.12 suffers from a bug with remote builders… + package = pkgs.nixVersions.nix_2_13; # should be enough? nrBuildUsers = 128; + # https://github.com/NixOS/nix/issues/719 + daemonCPUSchedPolicy = "batch"; + daemonIOSchedClass = "best-effort"; + daemonIOSchedPriority = 5; + settings = { keep-outputs = true; keep-derivations = true; - use-cgroups = true; - http-connections = 0; - auto-allocate-uids = true; - cores = 64; # 128 is too much, it will explode the RAM for now. Let's keep it serious. - max-jobs = 2; # Do not build more than 2 derivations at once in the event, both of them are too big, yes this is stupid, fix it in Nix. - fsync-metadata = true; + max-jobs = 42; # 64 is too much, it will explode the RAM for now. Let's keep it serious. + # in zfs we trust + fsync-metadata = lib.boolToString (!config.boot.isContainer or config.fileSystems."/".fsType != "zfs"); substituters = [ "https://nix-community.cachix.org" "https://tum-dse.cachix.org" @@ -74,14 +64,6 @@ in "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "tum-dse.cachix.org-1:v67rK18oLwgO0Z4b69l30SrV1yRtqxKpiHodG4YxhNM=" ]; - experimental-features = [ - "auto-allocate-uids" - "ca-derivations" - "cgroups" - "discard-references" - "fetch-closure" - "impure-derivations" - ]; }; }; diff --git a/modules/packages.nix b/modules/packages.nix index 7d84ab0..5503b6e 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -35,8 +35,6 @@ usbutils ipmitool - - nix-top # tries to default to soft-float due to out-dated cc-rs ] ++ lib.optional (!stdenv.hostPlatform.isRiscV) bandwhich; }