{ pkgs, lib, config, inputs, ... }@args: let builder = { systems = [ "x86_64-linux" "i686-linux" ]; speedFactor = 4; supportedFeatures = [ "benchmark" "nixos-test" ]; sshKey = config.age.secrets.nixBuilderKey.path; }; bigBuilder = builder // { speedFactor = 16; supportedFeatures = builder.supportedFeatures ++ [ "kvm" "big-parallel" ]; }; in { age.secrets.nixBuilderKey = { file = ../../secrets/builder_key.age; mode = "0400"; }; nixpkgs.overlays = [ (self: super: { nixSuper = inputs.nix-super.defaultPackage.x86_64-linux; }) ]; nix = { package = pkgs.nixSuper; settings = { trusted-users = [ "root" "@wheel" ]; auto-optimise-store = true; substituters = [ "https://cache.privatevoid.net" "https://max.cachix.org?priority=100" "https://reflex.privatevoid.net?priority=90" ]; trusted-public-keys = [ "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg=" "max.cachix.org-1:oSMQ1zYLR8H4L17hfe6ETlI/d+VeiBykB8PbBdPtDJw=" ]; }; extraOptions = '' experimental-features = nix-command flakes warn-dirty = false builders-use-substitutes = true flake-registry = ${ pkgs.writeText "null-registry.json" ''{"flakes":[],"version":2}'' } ''; gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 30d"; }; distributedBuilds = true; buildMachines = [ (bigBuilder // { sshUser = "nixbuilder"; hostName = "animus.com"; maxJobs = 4; }) ] ++ (lib.optional (config.networking.hostName != "TITAN") (bigBuilder // { sshUser = "nix"; hostName = "titan.hypr"; speedFactor = 12; maxJobs = 12; })); }; environment.systemPackages = [ pkgs.cachix ]; }