hydra: include ssh config for future build machines

This commit is contained in:
Christoph Hollizeck 2025-12-02 01:34:55 +01:00
parent 8ee3088b93
commit 4a5016ce07
Signed by: Daholli
GPG key ID: 249300664F2AF2C7

View file

@ -1,17 +1,25 @@
{ {
flake.modules.nixos.hydra = flake.modules.nixos.hydra =
{ config, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
httpPort = 2000; httpPort = 2000;
generateHostEntry = machine: ''
Host ${machine.hostName}
IdentitiesOnly yes
IdentityFile ${machine.sshKey}
User remotebuild
'';
filteredMachines = lib.filter (machine: machine.hostName != "localhost") config.nix.buildMachines;
remotebuild-ssh-config = pkgs.writeTextFile { remotebuild-ssh-config = pkgs.writeTextFile {
name = "remotebuild-ssh-config"; name = "remotebuild-ssh-config";
text = '' text = lib.concatMapStringsSep "\n" generateHostEntry filteredMachines;
Host nixberry
IdentitiesOnly yes
IdentityFile ${config.sops.secrets."hydra/remotebuild/private-key".path}
User remotebuild
'';
}; };
in in
{ {