2022-10-02 16:49:43 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2023-01-02 19:10:33 +01:00
|
|
|
nixos-exporter = {
|
|
|
|
url = "git+https://git.clerie.de/clerie/nixos-exporter.git";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-02-06 13:38:16 +01:00
|
|
|
solid-xmpp-alarm = {
|
|
|
|
url = "git+https://git.clerie.de/clerie/solid-xmpp-alarm.git";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2022-10-02 16:49:43 +02:00
|
|
|
};
|
2023-02-06 13:38:16 +01:00
|
|
|
outputs = { self, nixpkgs, nixos-exporter, solid-xmpp-alarm, ... }: let
|
2022-10-02 20:38:02 +02:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
overlays = [
|
|
|
|
(import ./pkgs/overlay.nix)
|
|
|
|
];
|
|
|
|
system = "x86_64-linux";
|
|
|
|
};
|
|
|
|
system = "x86_64-linux";
|
|
|
|
in {
|
2022-12-31 23:28:10 +01:00
|
|
|
nixosConfigurations = let
|
|
|
|
generateNixosSystem = name: nixpkgs.lib.nixosSystem {
|
2022-12-09 23:24:09 +01:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
2023-02-06 12:20:59 +01:00
|
|
|
({ ... }: {
|
|
|
|
/*
|
|
|
|
Make the contents of the flake availiable to modules.
|
|
|
|
Useful for having the monitoring server scraping the
|
|
|
|
target config from all other servers automatically.
|
|
|
|
*/
|
|
|
|
_module.args._nixfiles = self;
|
|
|
|
})
|
2022-12-09 23:24:09 +01:00
|
|
|
./configuration/common
|
2023-01-02 19:10:33 +01:00
|
|
|
({ ... }: {
|
|
|
|
nixpkgs.overlays = [
|
|
|
|
(_: _: {
|
|
|
|
inherit (nixos-exporter.packages.${system})
|
|
|
|
nixos-exporter;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
})
|
2023-02-06 13:38:16 +01:00
|
|
|
solid-xmpp-alarm.nixosModules.solid-xmpp-alarm
|
2022-12-31 23:28:10 +01:00
|
|
|
(./hosts + "/${name}/configuration.nix")
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
aluminium = generateNixosSystem "aluminium";
|
|
|
|
backup-4 = generateNixosSystem "backup-4";
|
|
|
|
beryllium = generateNixosSystem "beryllium";
|
|
|
|
carbon = generateNixosSystem "carbon";
|
|
|
|
clerie-backup = generateNixosSystem "clerie-backup";
|
|
|
|
dn42-il-gw1 = generateNixosSystem "dn42-il-gw1";
|
|
|
|
dn42-il-gw5 = generateNixosSystem "dn42-il-gw5";
|
|
|
|
dn42-il-gw6 = generateNixosSystem "dn42-il-gw6";
|
|
|
|
dn42-ildix-clerie = generateNixosSystem "dn42-ildix-clerie";
|
|
|
|
gatekeeper = generateNixosSystem "gatekeeper";
|
|
|
|
hydra-1 = generateNixosSystem "hydra-1";
|
|
|
|
hydra-2 = generateNixosSystem "hydra-2";
|
|
|
|
minecraft-2 = generateNixosSystem "minecraft-2";
|
|
|
|
monitoring-3 = generateNixosSystem "monitoring-3";
|
|
|
|
nonat = generateNixosSystem "nonat";
|
|
|
|
osmium = generateNixosSystem "osmium";
|
|
|
|
palladium = generateNixosSystem "palladium";
|
|
|
|
porter = generateNixosSystem "porter";
|
|
|
|
schule = generateNixosSystem "schule";
|
|
|
|
storage-2 = generateNixosSystem "storage-2";
|
|
|
|
web-2 = generateNixosSystem "web-2";
|
2023-02-26 18:45:26 +01:00
|
|
|
_iso = generateNixosSystem "_iso";
|
2022-10-03 15:26:15 +02:00
|
|
|
};
|
|
|
|
|
2022-10-02 16:49:43 +02:00
|
|
|
colmena = {
|
|
|
|
meta = {
|
|
|
|
nixpkgs = import nixpkgs {};
|
|
|
|
};
|
|
|
|
|
|
|
|
defaults = { name, ... }: {
|
|
|
|
deployment = {
|
|
|
|
targetHost = "${name}.net.clerie.de";
|
|
|
|
targetUser = null;
|
|
|
|
};
|
|
|
|
};
|
2022-10-03 15:26:15 +02:00
|
|
|
} // builtins.mapAttrs (name: host: {
|
|
|
|
nixpkgs.system = host.config.nixpkgs.system;
|
|
|
|
imports = host._module.args.modules;
|
2022-12-09 23:24:09 +01:00
|
|
|
deployment.allowLocalDeployment = builtins.any (n: n == name) [ "schule" "osmium" ];
|
2022-10-03 15:26:15 +02:00
|
|
|
}) self.nixosConfigurations;
|
2022-10-02 20:38:02 +02:00
|
|
|
packages.x86_64-linux = {
|
|
|
|
inherit (pkgs)
|
|
|
|
anycast_healthchecker
|
|
|
|
flask-excel
|
|
|
|
iot-data
|
|
|
|
pyexcel-xlsx
|
|
|
|
pyexcel-webio
|
|
|
|
uptimestatus
|
|
|
|
wetter;
|
|
|
|
};
|
|
|
|
|
|
|
|
hydraJobs = {
|
2022-10-03 15:26:15 +02:00
|
|
|
inherit (self)
|
|
|
|
packages;
|
|
|
|
nixosConfigurations = builtins.mapAttrs (name: host: host.config.system.build.toplevel) self.nixosConfigurations;
|
2023-02-26 18:45:26 +01:00
|
|
|
iso = self.nixosConfigurations._iso.config.system.build.isoImage;
|
2022-10-02 20:38:02 +02:00
|
|
|
};
|
2022-10-02 16:49:43 +02:00
|
|
|
};
|
|
|
|
}
|