wip: nixpkgs versions + infra network + monitoring

Signed-off-by: Jeltz <jeltz@federez.net>
This commit is contained in:
jeltz 2025-04-05 17:33:42 +02:00
parent 01b5a0fe25
commit a64b34810d
Signed by: jeltz
GPG key ID: 800882B66C0C3326
24 changed files with 1363 additions and 513 deletions

View file

@ -1,20 +1,31 @@
let
src = import ./npins;
pkgs = import src.nixpkgs {
disko = (import src.disko { inherit (nixpkgsDefault) lib; });
diskConfig = import ./disks/ext4.nix {
# FIXME mauvaise version…
inherit (nixpkgsDefault) lib;
};
mkSpecialArgs = nixpkgs: {
network = import ./network {
inherit (nixpkgs) lib;
};
};
nixpkgsDefault = import src.nixpkgs {
config.permittedInsecurePackages = [ "olm-3.2.16" ];
};
disko = (import src.disko { inherit (pkgs) lib; });
diskConfig = import ./disks/ext4.nix {
inherit (pkgs) lib;
nixpkgs2411 = import src."nixpkgs-24.11" { };
nodeNixpkgs = {
# FIXME discourse est cassé en unstable
pendragon = nixpkgs2411;
martagon = nixpkgs2411;
};
in
{
meta = {
nixpkgs = pkgs;
nodeNixpkgs = {
# FIXME discourse est cassé en unstable
pendragon = src."nixpkgs-24.11";
};
nixpkgs = nixpkgsDefault;
nodeNixpkgs = nodeNixpkgs;
specialArgs = mkSpecialArgs nixpkgsDefault;
nodeSpecialArgs = builtins.mapAttrs (_: mkSpecialArgs) nodeNixpkgs;
};
# FIXME
@ -23,6 +34,8 @@ in
defaults = { pkgs, lib, ... }: {
imports = [
./profiles/sysadmin.nix
./profiles/infra.nix
./profiles/prometheus-node-exporter.nix
#./profiles/ldap.nix
"${src.agenix}/modules/age.nix"
];
@ -38,12 +51,14 @@ in
services.openssh.enable = true;
networking.nftables.enable = true;
infra.enabled = true;
# Enable system diffs.
system.activationScripts.system-diff = {
supportsDryActivation = true; # safe: only outputs to stdout
text = ''
if [ -e /run/current-system ]; then
PATH=$PATH:${pkgs.nix}/bin ${pkgs.nvd}/bin/nvd diff /run/current-system $systemConfig
PATH=$PATH:${pkgs.nix}/bin ${pkgs.nvd}/bin/nvd diff /run/current-system $systemConfig
fi
'';
};
@ -72,16 +87,10 @@ in
wan-mac = "BC:24:11:5C:A4:5A";
};
infra-net.leaf = {
mac = "BC:24:11:AC:7B:59";
id = 12;
};
imports = [
(disko.config diskConfig)
./profiles/vm.nix
./profiles/glucagon.nix
./profiles/infra-net.nix
./profiles/matrix-server.nix
./profiles/element.nix
./profiles/telegram-bot.nix
@ -99,16 +108,10 @@ in
wan-mac = "BC:24:11:EA:6C:0B";
};
infra-net.leaf = {
mac = "BC:24:11:5A:0F:44";
id = 8;
};
imports = [
(disko.config diskConfig)
./profiles/vm.nix
./profiles/glucagon.nix
./profiles/infra-net.nix
./profiles/vaultwarden.nix
];
@ -123,16 +126,10 @@ in
wan-mac = "BC:24:11:7F:19:60";
};
infra-net.leaf = {
mac = "BC:24:11:91:61:8E";
id = 9;
};
imports = [
(disko.config diskConfig)
./profiles/vm.nix
./profiles/glucagon.nix
./profiles/infra-net.nix
./profiles/wayf.nix
];
@ -147,16 +144,10 @@ in
wan-mac = "BC:24:11:E3:12:4A";
};
infra-net.leaf = {
mac = "BC:24:11:E4:C7:69";
id = 10;
};
imports = [
(disko.config diskConfig)
./profiles/vm.nix
./profiles/glucagon.nix
./profiles/infra-net.nix
./profiles/gitlab.nix
];
@ -171,16 +162,10 @@ in
wan-mac = "BC:24:11:C2:AA:47";
};
infra-net.leaf = {
mac = "BC:24:11:31:B8:DD";
id = 11;
};
imports = [
(disko.config diskConfig)
./profiles/vm.nix
./profiles/glucagon.nix
./profiles/infra-net.nix
./profiles/discourse.nix
];
@ -195,23 +180,16 @@ in
wan-mac = "BC:24:11:04:9B:51";
};
infra-net.leaf = {
mac = "BC:24:11:09:B8:76";
id = 17;
};
imports = [
(disko.config diskConfig)
./profiles/vm.nix
./profiles/glucagon.nix
./profiles/indico.nix
];
};
martagon = { name, nodes, ... }: {
martagon = { pkgs, ... }: {
deployment.tags = [ "victoria" "grafana" ];
deployment.targetHost = "martagon.federez.net";
federez.monitoring.apiKey = "370a181d-6b00-4c3d-af27-ca65e6e4c1b0";
networking.hostName = name;
glucagon.networking = {
nibble = 236;
@ -219,9 +197,13 @@ in
};
imports = [
(disko.config diskConfig)
./profiles/vm.nix
./profiles/victoria.nix
./profiles/glucagon.nix
./profiles/monitoring
./profiles/grafana.nix
];
system.build.diskoScript = disko.diskoScript diskConfig pkgs;
};
}