chore: filter configurations through colmena tags

This commit is contained in:
Julien Malka 2024-05-26 20:24:00 +02:00
parent 216f797cdb
commit 0cd5248dc4
Signed by: Luj
GPG key ID: 6FC74C847011FD83
6 changed files with 17 additions and 18 deletions
default.nix
machines
core-data
core-security
gustave
lambda
lisa

View file

@ -46,23 +46,16 @@ rec {
}) })
) (lib.importConfig ./machines); ) (lib.importConfig ./machines);
colmena = colmena = {
let meta = {
deployableConfigurations = lib.filterAttrs ( nodeNixpkgs = builtins.mapAttrs (
_: v: builtins.hasAttr "ipv4" lib.luj.machines.${v.config.networking.hostName} n: _: import lib.luj.machines.${n}.nixpkgs_version
) nixosConfigurations; ) nixosConfigurations;
in nodeSpecialArgs = builtins.mapAttrs (
{ n: v: v._module.specialArgs // { lib = mkLibForMachine n; }
meta = { ) nixosConfigurations;
nodeNixpkgs = builtins.mapAttrs ( };
n: _: import lib.luj.machines.${n}.nixpkgs_version } // builtins.mapAttrs (_: v: { imports = v._module.args.modules; }) nixosConfigurations;
) deployableConfigurations;
nodeSpecialArgs = builtins.mapAttrs (
n: v: v._module.specialArgs // { lib = mkLibForMachine n; }
) deployableConfigurations;
};
}
// builtins.mapAttrs (_: v: { imports = v._module.args.modules; }) deployableConfigurations;
packages = builtins.listToAttrs ( packages = builtins.listToAttrs (
builtins.map (plat: { builtins.map (plat: {

View file

@ -8,8 +8,7 @@
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
deployment.targetHost = lib.mkForce "192.168.0.57"; deployment.tags = [ "server" ];
deployment.targetPort = lib.mkForce 45;
luj.nginx.enable = true; luj.nginx.enable = true;

View file

@ -15,6 +15,8 @@
boot.loader.grub.device = "/dev/sda"; boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true; boot.loader.grub.useOSProber = true;
deployment.tags = [ "server" ];
systemd.network.enable = true; systemd.network.enable = true;
systemd.network.networks."10-wan" = { systemd.network.networks."10-wan" = {
matchConfig.Name = "ens18"; matchConfig.Name = "ens18";

View file

@ -11,6 +11,8 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
deployment.tags = [ "server" ];
disko = import ./disko.nix; disko = import ./disko.nix;
systemd.network.enable = true; systemd.network.enable = true;

View file

@ -10,6 +10,7 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
deployment.buildOnTarget = true; deployment.buildOnTarget = true;
deployment.tags = [ "server" ];
luj.nginx.enable = true; luj.nginx.enable = true;

View file

@ -17,6 +17,8 @@
mailserver.enable = true; mailserver.enable = true;
}; };
deployment.tags = [ "server" ];
services.fail2ban.enable = true; services.fail2ban.enable = true;
networking.hostId = "fbb334ae"; networking.hostId = "fbb334ae";