diff --git a/hosts/epyc.nix b/hosts/epyc.nix index ac0864b..b41c69a 100644 --- a/hosts/epyc.nix +++ b/hosts/epyc.nix @@ -1,15 +1,9 @@ -{ lib, ... }: -let - gcc-system-features = arch: lib.optionals (arch != null) ([ "gccarch-${arch}" ] - ++ map (x: "gccarch-${x}") lib.systems.architectures.inferiors.${arch}); -in { imports = [ ../modules/ipmi-supermicro.nix ../modules/hardware/supermicro-H12SSL-i.nix ../modules/iperf-server.nix ../modules/hypervisor.nix - ../modules/hydra/coordinator.nix ]; networking.hostName = "epyc"; @@ -24,18 +18,7 @@ in }; }; - nix.buildMachines = [ - { hostName = "localhost"; - systems = [ - "x86_64-linux" - "riscv64-linux" - ]; - supportedFeatures = [ "kvm" "nixos-test" "big-parallel" "benchmark" ] ++ gcc-system-features "znver3"; - maxJobs = 1; - } - ]; - - boot.binfmt.emulatedSystems = [ "riscv64-linux" "aarch64-linux" "riscv64-linux" ]; + boot.binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ]; simd.arch = "znver3"; system.stateVersion = "23.05"; diff --git a/modules/hydra/coordinator.nix b/modules/hydra/coordinator.nix deleted file mode 100644 index 55dda02..0000000 --- a/modules/hydra/coordinator.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ pkgs, ... }: { - services.hydra = { - enable = true; - hydraURL = "https://hydra.newtype.fr"; - notificationSender = "hydra@localhost"; - buildMachinesFiles = [ "/etc/nix/machines" ]; - useSubstitutes = true; - }; - - environment.systemPackages = [ pkgs.nix-prefetch-git ]; - nix.trustedUsers = [ "hydra" "hydra-www" ]; - - services.postgresql = { - enableJIT = true; - settings = { - checkpoint_completion_target = "0.9"; - default_statistics_target = 100; - - max_connections = 500; - work_mem = "20MB"; - maintenance_work_mem = "2GB"; - - shared_buffers = "8GB"; - - min_wal_size = "1GB"; - max_wal_size = "2GB"; - wal_buffers = "16MB"; - - max_worker_processes = 16; - max_parallel_workers_per_gather = 8; - max_parallel_workers = 16; - - # NVMe related performance tuning - effective_io_concurrency = 200; - random_page_cost = "1.1"; - - # We can risk losing some transactions. - synchronous_commit = "off"; - - effective_cache_size = "16GB"; - - # autovacuum and autoanalyze much more frequently: - # at these values vacuum should run approximately - # every 2 mass rebuilds, or a couple times a day - # on the builds table. Some of those queries really - # benefit from frequent vacuums, so this should - # help. In particular, I'm thinking the jobsets - # pages. - autovacuum_vacuum_scale_factor = 0.002; - autovacuum_analyze_scale_factor = 0.001; - - shared_preload_libraries = "pg_stat_statements"; - compute_query_id = "on"; - }; - }; - - security.acme = { - acceptTerms = true; - defaults.email = "ryan@lahfa.xyz"; - }; - - services.nginx = { - enable = true; - - recommendedZstdSettings = true; - recommendedBrotliSettings = true; - recommendedGzipSettings = true; - recommendedOptimisation =true; - recommendedTlsSettings = true; - recommendedProxySettings = true; - }; - - services.nginx.virtualHosts."hydra.newtype.fr" = { - forceSSL = true; - enableACME = true; - # TODO: remove compression for some locations - locations."/".proxyPass = "http://localhost:3000"; - }; - - networking.firewall.allowedTCPPorts = [ 80 443 ]; -} diff --git a/modules/nix-daemon.nix b/modules/nix-daemon.nix index 3120c3d..b45d3a8 100644 --- a/modules/nix-daemon.nix +++ b/modules/nix-daemon.nix @@ -42,17 +42,13 @@ in package = pkgs.nixVersions.nix_2_13; # should be enough? - nrBuildUsers = 128; + nrBuildUsers = lib.mkDefault 32; # https://github.com/NixOS/nix/issues/719 - daemonCPUSchedPolicy = "batch"; - daemonIOSchedClass = "best-effort"; - daemonIOSchedPriority = 5; settings = { keep-outputs = true; keep-derivations = true; - max-jobs = 64; # in zfs we trust fsync-metadata = lib.boolToString (!config.boot.isContainer or config.fileSystems."/".fsType != "zfs"); substituters = [