hydra: include ssh config for future build machines
This commit is contained in:
parent
8ee3088b93
commit
4a5016ce07
1 changed files with 15 additions and 7 deletions
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue