Automated installation of host keys
This commit is contained in:
parent
00935e8501
commit
d719a974c2
|
@ -1004,11 +1004,11 @@
|
||||||
"pixelfed": "pixelfed"
|
"pixelfed": "pixelfed"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730977329,
|
"lastModified": 1731083725,
|
||||||
"narHash": "sha256-1/txLla4VANl2g/oyf5ehG5QSGauO/yvOzrblqzJzN8=",
|
"narHash": "sha256-+wmQoX+EXcxM/94vmc91hvR750SGXFsx3WhSYxHwMHA=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "cd194f818df0f1752da4ef15c1e435586d28b596",
|
"rev": "2d522f51f5b61041a2468ff3bb4eb38704081dbc",
|
||||||
"revCount": 97,
|
"revCount": 99,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.fediversity.eu/fediversity/simple-nixos-fediverse.git"
|
"url": "https://git.fediversity.eu/fediversity/simple-nixos-fediverse.git"
|
||||||
},
|
},
|
||||||
|
|
21
flake.nix
21
flake.nix
|
@ -81,18 +81,35 @@
|
||||||
let
|
let
|
||||||
inherit (builtins) mapAttrs;
|
inherit (builtins) mapAttrs;
|
||||||
in
|
in
|
||||||
mapAttrs (_: snf.mkInstaller nixpkgs) self.nixosConfigurations.provisioning;
|
mapAttrs (
|
||||||
|
vmname:
|
||||||
|
snf.mkInstaller {
|
||||||
|
inherit nixpkgs;
|
||||||
|
hostKeys = {
|
||||||
|
rsa = {
|
||||||
|
private = ./hostKeys/${vmname}/ssh_host_rsa_key;
|
||||||
|
public = ./hostKeys/${vmname}/ssh_host_rsa_key.pub;
|
||||||
|
};
|
||||||
|
ed25519 = {
|
||||||
|
private = ./hostKeys/${vmname}/ssh_host_ed25519_key;
|
||||||
|
public = ./hostKeys/${vmname}/ssh_host_ed25519_key.pub;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
) self.nixosConfigurations.provisioning;
|
||||||
|
|
||||||
nixops4Deployments.default =
|
nixops4Deployments.default =
|
||||||
{ providers, ... }:
|
{ providers, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (builtins) readFile;
|
||||||
|
|
||||||
makeProcolixVmResource = vmid: vmconfig: {
|
makeProcolixVmResource = vmid: vmconfig: {
|
||||||
type = providers.local.exec;
|
type = providers.local.exec;
|
||||||
imports = [ inputs.nixops4-nixos.modules.nixops4Resource.nixos ];
|
imports = [ inputs.nixops4-nixos.modules.nixops4Resource.nixos ];
|
||||||
ssh.opts = "";
|
ssh.opts = "";
|
||||||
ssh.host = "95.215.187.${vmid}";
|
ssh.host = "95.215.187.${vmid}";
|
||||||
ssh.hostPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOW+f+PUuOBVP4IongWpryzYiOwt19smufZksSwnSPyo";
|
ssh.hostPublicKey = readFile ./hostKeys/fedi${vmid}/ssh_host_ed25519_key.pub;
|
||||||
|
|
||||||
nixpkgs = inputs.nixpkgs;
|
nixpkgs = inputs.nixpkgs;
|
||||||
nixos.module =
|
nixos.module =
|
||||||
|
|
Reference in a new issue