From fa94214498bcb5519bfaebe7a5a62081fea389ac Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:05:35 -0700 Subject: [PATCH] async distributed compilation --- flake.nix | 7 +++++++ systems/NOcomputer.nix | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/flake.nix b/flake.nix index bc399a9..5da66fa 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,13 @@ nixos-cosmic, ... } @ inputs: { + hydraJobs = { + # inherit + # (self) + # nixosConfigurations.NOlaptop + # ; + x86_64-linux.NOlaptop = self.nixosConfigurations.NOlaptop.config.system.build.toplevel; + }; nixosConfigurations = { NOcomputer = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; diff --git a/systems/NOcomputer.nix b/systems/NOcomputer.nix index e342934..6b89c43 100644 --- a/systems/NOcomputer.nix +++ b/systems/NOcomputer.nix @@ -13,6 +13,28 @@ boot.kernel.sysctl."net.ipv4.ip_forward" = "1"; boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = "1"; + nix.buildMachines = [ + { + hostName = "localhost"; + systems = ["x86_64-linux" "i686-linux"]; + supportedFeatures = ["big-parallel" "kvm" "nixos-test" "benchmark"]; + } + ]; + nix.extraOptions = '' + builders-use-substitutes = true + ''; + services.hydra = { + enable = true; + hydraURL = "http://localhost:3000"; + notificationSender = "hydra@localhost"; + useSubstitutes = true; + }; + nix.settings.allowed-uris = [ + "github:" + "git+https://github.com/" + "git+ssh://github.com/" + ]; + # services.foldingathome = { # enable = true; # team = 223518;