2023-01-19 23:23:41 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
2023-01-19 23:55:56 +00:00
|
|
|
inherit (lib) attrValues filterAttrs mkMerge mkOption types;
|
2023-01-19 23:23:41 +00:00
|
|
|
cfg = config.sane.hosts;
|
|
|
|
|
|
|
|
host = types.submodule ({ config, ... }: {
|
|
|
|
options = {
|
|
|
|
ssh.user_pubkey = mkOption {
|
2023-01-20 07:07:45 +00:00
|
|
|
type = types.str;
|
2023-01-19 23:23:41 +00:00
|
|
|
description = ''
|
|
|
|
ssh pubkey that the primary user of this machine will use when connecting to other machines.
|
|
|
|
e.g. "ssh-ed25519 AAAA<base64>".
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
ssh.host_pubkey = mkOption {
|
2023-01-20 07:07:45 +00:00
|
|
|
type = types.str;
|
2023-01-19 23:23:41 +00:00
|
|
|
description = ''
|
|
|
|
ssh pubkey which this host will present to connections initiated against it.
|
|
|
|
e.g. "ssh-ed25519 AAAA<base64>".
|
|
|
|
'';
|
|
|
|
};
|
2023-01-20 06:09:57 +00:00
|
|
|
wg-home.pubkey = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
2023-01-20 07:42:31 +00:00
|
|
|
default = null;
|
2023-01-20 06:09:57 +00:00
|
|
|
description = ''
|
|
|
|
wireguard public key for the wg-home VPN.
|
|
|
|
e.g. "pWtnKW7f7sNIZQ2M83uJ7cHg3IL1tebE3IoVkCgjkXM=".
|
|
|
|
'';
|
|
|
|
};
|
2023-01-20 07:22:34 +00:00
|
|
|
wg-home.ip = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
2023-01-20 07:42:31 +00:00
|
|
|
default = null;
|
2023-01-20 07:22:34 +00:00
|
|
|
description = ''
|
|
|
|
IP address to use on the wg-home VPN.
|
|
|
|
e.g. "10.0.10.5";
|
|
|
|
'';
|
|
|
|
};
|
2023-01-20 07:42:31 +00:00
|
|
|
wg-home.endpoint = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
};
|
2023-01-20 07:07:45 +00:00
|
|
|
lan-ip = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
description = ''
|
|
|
|
ip address when on the lan.
|
|
|
|
e.g. "192.168.0.5";
|
|
|
|
'';
|
|
|
|
};
|
2023-01-19 23:23:41 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
2023-01-19 23:55:56 +00:00
|
|
|
sane.hosts.by-name = mkOption {
|
2023-01-19 23:23:41 +00:00
|
|
|
type = types.attrsOf host;
|
|
|
|
default = {};
|
|
|
|
description = ''
|
|
|
|
map of hostname => attrset of information specific to that host,
|
|
|
|
like its ssh pubkey, etc.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
2023-01-19 23:55:56 +00:00
|
|
|
# TODO: this should be populated per-host
|
|
|
|
sane.hosts.by-name."desko" = {
|
2023-01-19 23:23:41 +00:00
|
|
|
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPU5GlsSfbaarMvDA20bxpSZGWviEzXGD8gtrIowc1pX";
|
|
|
|
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFw9NoRaYrM6LbDd3aFBc4yyBlxGQn8HjeHd/dZ3CfHk";
|
2023-01-20 07:59:11 +00:00
|
|
|
wg-home.pubkey = "17PMZssYi0D4t2d0vbmhjBKe1sGsE8kT8/dod0Q2CXc=";
|
|
|
|
wg-home.ip = "10.0.10.22";
|
2023-04-01 23:50:53 +00:00
|
|
|
lan-ip = "192.168.15.25";
|
2023-01-19 23:23:41 +00:00
|
|
|
};
|
2023-01-20 06:09:57 +00:00
|
|
|
|
2023-01-19 23:55:56 +00:00
|
|
|
sane.hosts.by-name."lappy" = {
|
2023-01-19 23:23:41 +00:00
|
|
|
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDpmFdNSVPRol5hkbbCivRhyeENzb9HVyf9KutGLP2Zu";
|
|
|
|
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSJnqmVl9/SYQ0btvGb0REwwWY8wkdkGXQZfn/1geEc";
|
2023-01-20 06:57:49 +00:00
|
|
|
wg-home.pubkey = "FTUWGw2p4/cEcrrIE86PWVnqctbv8OYpw8Gt3+dC/lk=";
|
2023-01-20 07:22:34 +00:00
|
|
|
wg-home.ip = "10.0.10.20";
|
2023-04-01 23:50:53 +00:00
|
|
|
lan-ip = "192.168.15.13";
|
2023-01-19 23:23:41 +00:00
|
|
|
};
|
2023-01-20 06:09:57 +00:00
|
|
|
|
2023-01-19 23:55:56 +00:00
|
|
|
sane.hosts.by-name."moby" = {
|
2023-01-19 23:23:41 +00:00
|
|
|
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrR+gePnl0nV/vy7I5BzrGeyVL+9eOuXHU1yNE3uCwU";
|
|
|
|
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1N/IT3nQYUD+dBlU1sTEEVMxfOyMkrrDeyHcYgnJvw";
|
2023-01-20 22:40:58 +00:00
|
|
|
wg-home.pubkey = "I7XIR1hm8bIzAtcAvbhWOwIAabGkuEvbWH/3kyIB1yA=";
|
|
|
|
wg-home.ip = "10.0.10.48";
|
2023-04-01 23:50:53 +00:00
|
|
|
lan-ip = "192.168.15.28";
|
2023-01-19 23:23:41 +00:00
|
|
|
};
|
2023-01-20 06:09:57 +00:00
|
|
|
|
2023-01-19 23:55:56 +00:00
|
|
|
sane.hosts.by-name."servo" = {
|
2023-01-19 23:23:41 +00:00
|
|
|
ssh.user_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPS1qFzKurAdB9blkWomq8gI1g0T3sTs9LsmFOj5VtqX";
|
|
|
|
ssh.host_pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOfdSmFkrVT6DhpgvFeQKm3Fh9VKZ9DbLYOPOJWYQ0E8";
|
2023-01-20 07:11:37 +00:00
|
|
|
wg-home.pubkey = "roAw+IUFVtdpCcqa4khB385Qcv9l5JAB//730tyK4Wk=";
|
2023-01-20 07:22:34 +00:00
|
|
|
wg-home.ip = "10.0.10.5";
|
2023-01-20 10:34:04 +00:00
|
|
|
wg-home.endpoint = "uninsane.org:51820";
|
2023-04-01 16:55:30 +00:00
|
|
|
lan-ip = "192.168.15.24";
|
2023-01-19 23:23:41 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|