diff --git a/flake.nix b/flake.nix index 297bc74..bbbac84 100644 --- a/flake.nix +++ b/flake.nix @@ -319,14 +319,7 @@ nixosImages.phone = nixosConfigurations.phone.config.mobile.outputs.disk-image; nixosImages.phone-fastboot = nixosConfigurations.phone.config.mobile.outputs.android.android-fastboot-image; - hydraJobs = let - addMeta = x: x // { - meta = (x.meta or {}) // { - timeout = 60 * 60 * 10; - maxSilent = 60 * 60 * 10; - }; - }; - in builtins.mapAttrs (_: addMeta) { + hydraJobs = { server.${config.server.system} = nixosConfigurations.server.config.system.build.toplevel; workstation.${config.nixmsi.system} = nixosConfigurations.nixmsi.config.system.build.toplevel; router.${config.router-emmc.system} = nixosConfigurations.router-emmc-cross.config.system.build.toplevel; diff --git a/system/hosts/nixmsi.nix b/system/hosts/nixmsi.nix index 20dc4e4..5203667 100644 --- a/system/hosts/nixmsi.nix +++ b/system/hosts/nixmsi.nix @@ -151,8 +151,13 @@ programs.ccache.enable = true; services.sshd.enable = true; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + users.users.hydra-builder = { + uid = 1001; + isNormalUser = true; + }; nix.settings = { netrc-file = "/secrets/netrc"; + trusted-users = [ "hydra-builder" ]; substituters = [ "https://binarycache.pavluk.org" "https://cache.nixos.org/" diff --git a/system/hosts/server/home.nix b/system/hosts/server/home.nix index d356bb5..a3ee7ed 100644 --- a/system/hosts/server/home.nix +++ b/system/hosts/server/home.nix @@ -146,6 +146,16 @@ in { supportedFeatures = [ "kvm" "local" "nixos-test" "benchmark" "big-parallel" ]; systems = [ "builtin" "x86_64-linux" "aarch64-linux" ]; } + { + hostName = cfg.laptopHostname; + maxJobs = 1; + speedFactor = 2; + protocol = "ssh-ng"; + systems = [ "x86_64-linux" ]; + supportedFeatures = [ "kvm" "nixos-test" "benchmark" "big-parallel" ]; + sshKey = "/secrets/hydra-builder-key"; + sshUser = "hydra-builder"; + } ]; # limit CI CPU usage since I'm running everything else off this server too systemd.services.nix-daemon.serviceConfig.CPUQuota = "100%"; diff --git a/system/hosts/server/options.nix b/system/hosts/server/options.nix index 5f3d591..4fb2142 100644 --- a/system/hosts/server/options.nix +++ b/system/hosts/server/options.nix @@ -9,6 +9,11 @@ default = "pavluk.org"; description = "domain name"; }; + laptopHostname = mkOption { + type = with types; nullOr str; + default = null; + description = "laptop hostname"; + }; keycloakRealm = mkOption { type = types.str; default = "master";