mirror of https://gitlab.crans.org/nounous/nixos
Merge branch 'comin' into 'main'
Draft: Auto-updates See merge request nounous/nixos!109merge-requests/109/merge
commit
849bebf0f1
125
flake.lock
125
flake.lock
|
|
@ -20,16 +20,54 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"comin": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1795253528,
|
||||||
|
"narHash": "sha256-TvzBvAV7KVWsvTCQjRg1oY/lhDbuN9YXLDctGGhXPdU=",
|
||||||
|
"owner": "nlewo",
|
||||||
|
"repo": "comin",
|
||||||
|
"rev": "4cc0f6a9764a0ac73ec248d1475a1372c19b4773",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nlewo",
|
||||||
|
"repo": "comin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1765121682,
|
||||||
|
"narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1790898470,
|
"lastModified": 1793576659,
|
||||||
"narHash": "sha256-zTwuwezD0w3hpga6a6P8emidzAZFyWqlNeRBlpWOOl8=",
|
"narHash": "sha256-V1h85lUaJBQoHFrB2vpXZOE0Ju1MYSnIpsehoVZYlDo=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "024633cd702b10285db5cb19b40ad48d2399ba60",
|
"rev": "ea2630b7470978622c7689a1ff75d2b389175399",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -40,11 +78,42 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1793294725,
|
"lastModified": 1770107345,
|
||||||
"narHash": "sha256-loLMnbbS4KhmG2ln9EY6f0YMNCA273Yx02oWYQ9IMeE=",
|
"narHash": "sha256-tbS0Ebx2PiA1FRW8mt8oejR0qMXmziJmPaU1d4kYY9g=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "4533d9293756b63904b7238acb84ac8fe4c8c2c4",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1793504054,
|
||||||
|
"narHash": "sha256-ThkfL3D/FhCiZFc9+3BtxwuMmpuK+/bGtXCSo1+yVew=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "7851ba61fd862b277cb6a9cef37394bc18bb94e4",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1795137884,
|
||||||
|
"narHash": "sha256-iKXCN36qYfBni+3nH4vAd98/kshoIsPB2S9mYWhma30=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6f06d204d8f2d8761d9da78778745974a3216381",
|
"rev": "ab5c18fdedfc8f9bbc9d773f10a540790e2787a7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -54,41 +123,45 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1790477367,
|
|
||||||
"narHash": "sha256-oujbxmVKDhci2E4EM3KyAbRUgp5/IsCoiA/LfEF7OOk=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"rev": "f7cd230690d9fc982d06129f9189b101fddcfa3b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixpkgs.lib",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
|
"comin": "comin",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix_2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"treefmt-nix": {
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1770228511,
|
||||||
|
"narHash": "sha256-wQ6NJSuFqAEmIg2VMnLdCnUc0b7vslUohqqGGD+Fyxk=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "337a4fe074be1042a35086f15481d763b8ddc0e7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1791885023,
|
"lastModified": 1795173499,
|
||||||
"narHash": "sha256-C3alQ2MEt0zVrUSho5NUDo3jmhbff72++bfwoqT9Omo=",
|
"narHash": "sha256-J8IYl3oEdctyvBgWr+/L01MY5Xm0TU4WXwZDccN5jjk=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "0d6d739a833ba9a9c93034862e4a7b061a062a1c",
|
"rev": "a0a97e31a897a3537eea5c49df4f8adaa83b3b37",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,12 @@
|
||||||
url = "github:ryantm/agenix";
|
url = "github:ryantm/agenix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Auto updates
|
||||||
|
comin = {
|
||||||
|
url = "github:nlewo/comin";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
@ -24,6 +30,7 @@
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-parts,
|
flake-parts,
|
||||||
agenix,
|
agenix,
|
||||||
|
comin,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
@ -46,6 +53,7 @@
|
||||||
baseModules = [
|
baseModules = [
|
||||||
./modules
|
./modules
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
|
comin.nixosModules.default
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
(attrsToNixosSystem ./hosts/vm attrs_all_info attrs_vm_info baseModules)
|
(attrsToNixosSystem ./hosts/vm attrs_all_info attrs_vm_info baseModules)
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,20 @@
|
||||||
|
|
||||||
monitoring = {
|
monitoring = {
|
||||||
nginx.enable = true;
|
nginx.enable = true;
|
||||||
|
comin.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
autoUpdate = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
main.enable = false;
|
||||||
|
testing.branch = "comin";
|
||||||
};
|
};
|
||||||
|
|
||||||
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";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
{ lib, info, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = info.autoUpdate;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Options ../info/autoupdate.nix
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.comin = {
|
||||||
|
enable = true;
|
||||||
|
buildAttemptsLimit = 3;
|
||||||
|
buildRetryTimer = 5 * 60;
|
||||||
|
buildTimeout = 2 * 60 * 60;
|
||||||
|
remotes = [
|
||||||
|
# TODO : à split en deux remotes, l'une pour main, l'autre pour testing
|
||||||
|
{
|
||||||
|
name = "origin";
|
||||||
|
url = "https://gitlab.adm.crans.org/nounous/nixos.git";
|
||||||
|
poller.period = cfg.period;
|
||||||
|
branches = {
|
||||||
|
main =
|
||||||
|
let
|
||||||
|
branch =
|
||||||
|
if cfg.main.enable then
|
||||||
|
{
|
||||||
|
branch = "name";
|
||||||
|
# period = cfg.main.period;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cfg.testing;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit (cfg) operation;
|
||||||
|
name = branch.branch;
|
||||||
|
};
|
||||||
|
testing = {
|
||||||
|
inherit (cfg) operation;
|
||||||
|
name = cfg.testing.branch;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
exporter = mkIf info.monitoring.comin.enable {
|
||||||
|
listen_address = info.networking.adm.ipv4.address;
|
||||||
|
port = 4267;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nix = mkIf (info.name != "cephiroth") {
|
||||||
|
distributedBuilds = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
max-jobs = 0;
|
||||||
|
builders-use-substitutes = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
buildMachines = [
|
||||||
|
{
|
||||||
|
hostName = "cephiroth.adm.crans.org";
|
||||||
|
sshUser = "builder";
|
||||||
|
sshKey = "/etc/ssh/ssh_host_ed25519_key";
|
||||||
|
system = "x86_64-linux";
|
||||||
|
maxJobs = 32;
|
||||||
|
supportedFeatures = [
|
||||||
|
"nixos-test"
|
||||||
|
"benchmark"
|
||||||
|
"big-parallel"
|
||||||
|
"kvm"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO : Autoreboot
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,7 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./age.nix
|
./age.nix
|
||||||
|
./autoupdate.nix
|
||||||
./grub.nix
|
./grub.nix
|
||||||
./home.nix
|
./home.nix
|
||||||
./locale.nix
|
./locale.nix
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkOption types;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.autoUpdate = {
|
||||||
|
enable = mkEnableOption "Activer les mises à jours automatiques.";
|
||||||
|
autoDeploy = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "Auto-déployer les changements construits.";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
autoReboot = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
description = "Définir une plage d'heure d'auto-reboot.";
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
operation = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "L'opération à effectuer (switch, test ou boot).";
|
||||||
|
example = "boot";
|
||||||
|
default = "switch";
|
||||||
|
};
|
||||||
|
period = mkOption {
|
||||||
|
type = types.ints.positive;
|
||||||
|
description = "Le délai entre chaque pull du git en secondes.";
|
||||||
|
default = 5 * 60;
|
||||||
|
};
|
||||||
|
|
||||||
|
main = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "Activer le suivi de la branche main.";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
# branch = mkOption {
|
||||||
|
# type = types.str;
|
||||||
|
# description = "La branche à suivre pour les mises à jours principales.";
|
||||||
|
# default = "main";
|
||||||
|
# };
|
||||||
|
# operation = mkOption {
|
||||||
|
# type = types.str;
|
||||||
|
# description = "L'opération à effectuer (switch, test ou boot).";
|
||||||
|
# example = "boot";
|
||||||
|
# default = "switch";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
|
||||||
|
testing = {
|
||||||
|
branch = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "La branche à suivre pour les tests.";
|
||||||
|
default = "testing-${config.name}";
|
||||||
|
};
|
||||||
|
# operation = mkOption {
|
||||||
|
# type = types.str;
|
||||||
|
# description = "L'opération à effectuer (switch, test ou boot).";
|
||||||
|
# example = "boot";
|
||||||
|
# default = "${config.autoUpdate.main.operation}";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -14,6 +14,7 @@ in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./acme.nix
|
./acme.nix
|
||||||
|
./autoupdate.nix
|
||||||
./home.nix
|
./home.nix
|
||||||
./meta.nix
|
./meta.nix
|
||||||
./monitoring.nix
|
./monitoring.nix
|
||||||
|
|
@ -27,7 +28,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.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,5 +14,14 @@ in
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
comin = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
example = true;
|
||||||
|
description = "Monitoring de Comin (l'auto-update) par prometheus.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue