mirror of https://gitlab.crans.org/nounous/nixos
Merge branch 'known-host' into 'main'
Known host via les info.nix See merge request nounous/nixos!111merge-requests/111/merge
commit
64da37189a
|
|
@ -3,6 +3,7 @@
|
||||||
description = "Serveur de stockage ceph";
|
description = "Serveur de stockage ceph";
|
||||||
id = 3;
|
id = 3;
|
||||||
|
|
||||||
|
enable = true;
|
||||||
# Sous Nix mais dans une autre branche
|
# Sous Nix mais dans une autre branche
|
||||||
isDebian = true;
|
isDebian = true;
|
||||||
|
|
||||||
|
|
@ -16,6 +17,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
resticClient.enable = false;
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOsBGkhiu6l3jeo15cQHMu3dPyL025zXPV2ZH02EDYEt root@cephiroth";
|
||||||
|
|
||||||
ilo = {
|
ilo = {
|
||||||
id = 53;
|
id = 53;
|
||||||
switch.salameche = 20;
|
switch.salameche = 20;
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,7 @@
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFKNg1b8ft1L55+joXQ/7Dt2QTOdkea8opTEnq4xrhPU root@thot";
|
||||||
|
|
||||||
resticClient.enable = false;
|
resticClient.enable = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,7 @@
|
||||||
|
|
||||||
homeNounou.enable = false;
|
homeNounou.enable = false;
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDCJV6jqQWEYuwi+OJ9r/4TbBN/cK9NvYWNiJhpFzcc7 root@apprentix";
|
||||||
|
|
||||||
users.root.passwordFile = ../../../secrets/apprentix/root.age;
|
users.root.passwordFile = ../../../secrets/apprentix/root.age;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,7 @@
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFa2D9fREtO2r2oIx6q9JAKFUHtxGbgEPMjkx09DQSU8 root@collabora";
|
||||||
|
|
||||||
resticClient.enable = false;
|
resticClient.enable = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
resticClient.when = "06:07";
|
resticClient.when = "06:07";
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGoR66An5huQucZlueQCcB/vwd085wrS2mUIz39e8QLt root@coturn";
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
acme.enable = true;
|
acme.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
resticClient.when = "02:34";
|
resticClient.when = "02:34";
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB6jVMIZ5y2oXX9HOkw7r5UUjw95MlFaFuu7FnEC0Q8z root@jitsi";
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
acme.enable = true;
|
acme.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,5 +25,7 @@
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEVfKNokHG6ig32hhQxTep+fKFmKahlDClPrX/dP4/gb root@livre";
|
||||||
|
|
||||||
resticClient.when = "03:45";
|
resticClient.when = "03:45";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,5 +38,7 @@
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFfcKtim7Aj+strHdg847D7KCCdoOAuasxx/2yi2TY1n root@mediakiwi";
|
||||||
|
|
||||||
resticClient.when = "06:47";
|
resticClient.when = "06:47";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
resticClient.when = "04:56";
|
resticClient.when = "04:56";
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMGfSvxqC2PJYRrxJaivVDujwlwCZ6AwH8hOSA9ktZ1V root@neo";
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
acme.enable = true;
|
acme.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,5 +25,7 @@
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMgSP9UmuJw8Bi2ML07WHsWvxN8akkc9XZxXyOgdjXkq root@nextcloud";
|
||||||
|
|
||||||
resticClient.enable = false;
|
resticClient.enable = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,5 +23,7 @@
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHTdfSIL3AWIv0mjRDam6E/qsjoqwJ8QSm1Cb0xqs1s1 root@periodique";
|
||||||
|
|
||||||
resticClient.when = "02:56";
|
resticClient.when = "02:56";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,5 +20,7 @@
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOx/lUQE6naP3EBy81sr93X8ktZmivU09ACx6T43Odhb root@reverseproxy";
|
||||||
|
|
||||||
resticClient.when = "03:42";
|
resticClient.when = "03:42";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPpaGf8A+XWXBdNrs69RiC0qPbjPHdtkl31OjxrktmF6 root@two";
|
||||||
|
|
||||||
resticClient.when = "07:29";
|
resticClient.when = "07:29";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,7 @@
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
publicSsh = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICn6vfDlsZVU6TEWg9vTgq9+Fp3irHjytBTky7A4ErRM root@vaultwarden";
|
||||||
|
|
||||||
resticClient.when = "04:44";
|
resticClient.when = "04:44";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,19 @@
|
||||||
{ ... }:
|
{
|
||||||
|
infra,
|
||||||
|
lib,
|
||||||
|
hosts,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
attrNames
|
||||||
|
concatMap
|
||||||
|
optional
|
||||||
|
mapAttrs'
|
||||||
|
mkIf
|
||||||
|
nameValuePair
|
||||||
|
;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -7,5 +21,34 @@
|
||||||
settings = {
|
settings = {
|
||||||
PermitRootLogin = "yes";
|
PermitRootLogin = "yes";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# knownHosts :
|
||||||
|
# {
|
||||||
|
# "host" = {
|
||||||
|
# hostNames = ["host.adm.crans.org" 172.16.10.2 …]
|
||||||
|
# publicKey = "ssh-ed25519…"
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
knownHosts = mapAttrs' (
|
||||||
|
n: conf:
|
||||||
|
nameValuePair n (
|
||||||
|
mkIf (conf.publicSsh != null) {
|
||||||
|
publicKey = conf.publicSsh;
|
||||||
|
|
||||||
|
hostNames = [
|
||||||
|
"${n}.adm.crans.org"
|
||||||
|
]
|
||||||
|
++ concatMap (
|
||||||
|
vlan:
|
||||||
|
let
|
||||||
|
netv = conf.networking.${vlan};
|
||||||
|
in
|
||||||
|
optional (netv.enable && (netv.ipv4.address or null) != null) netv.ipv4.address
|
||||||
|
++ optional (netv.enable && (netv.ipv6.address or null) != null) netv.ipv6.address
|
||||||
|
) (attrNames infra.vlans);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
) hosts;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ in
|
||||||
example = true;
|
example = true;
|
||||||
description = "Activer la configuration Crans par défaut";
|
description = "Activer la configuration Crans par défaut";
|
||||||
# On n’utilise pas mkEnableOption pour forcer la définition de enable à true
|
# On n’utilise pas mkEnableOption pour forcer la définition de enable à true
|
||||||
# ou false (et limiter les oublis)
|
# ou false (et limiter les oublis).
|
||||||
};
|
};
|
||||||
config = mkIf config.enable {
|
config = mkIf config.enable {
|
||||||
homeNounou.enable = mkDefault true;
|
homeNounou.enable = mkDefault true;
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,9 @@ in
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
public-ssh = mkOption {
|
publicSsh = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
description = "Clé ssh publique de la machine.";
|
description = "Clé ssh publique de la machine.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue