1
0

Compare commits

..

3 Commits

Author SHA1 Message Date
e777528435
flake.nix: Expose modules in flake 2024-05-13 16:33:20 +02:00
6beb8db05a
flake.nix: Move hydraJobs to seperate file 2024-05-13 16:21:47 +02:00
1f7ffd82ba
flake.nix: Remove colmena 2024-05-13 16:11:09 +02:00
6 changed files with 22 additions and 35 deletions

View File

@ -2,8 +2,6 @@
{ {
imports = [ imports = [
../../modules
./backup.nix ./backup.nix
./locale.nix ./locale.nix
./networking.nix ./networking.nix

View File

@ -13,7 +13,6 @@
# Deployment # Deployment
bij bij
colmena
clerie-sops clerie-sops
clerie-sops-edit clerie-sops-edit
sops sops

View File

@ -92,11 +92,10 @@
nixosConfigurations = helper.mapToNixosConfigurations self.clerie.hosts; nixosConfigurations = helper.mapToNixosConfigurations self.clerie.hosts;
colmena = { nixosModules = {
meta = { clerie = import ./modules;
nixpkgs = localNixpkgs.x86_64-linux; default = self.nixosModules.clerie;
}; };
} // helper.mapToColmenaHosts self.nixosConfigurations;
overlays = { overlays = {
nixfilesInputs = import ./flake/overlay.nix inputs; nixfilesInputs = import ./flake/overlay.nix inputs;
@ -130,12 +129,7 @@
inherit lib self; inherit lib self;
hydraJobs = { hydraJobs = import ./flake/hydraJobs.nix inputs;
inherit (self)
packages;
nixosConfigurations = helper.buildHosts self.nixosConfigurations;
iso = self.nixosConfigurations._iso.config.system.build.isoImage;
};
nixConfig = { nixConfig = {
extra-substituters = [ extra-substituters = [

15
flake/hydraJobs.nix Normal file
View File

@ -0,0 +1,15 @@
{ self
, nixpkgs
, ...
}@inputs:
let
buildHosts = hosts: builtins.mapAttrs (name: host: host.config.system.build.toplevel) (nixpkgs.lib.filterAttrs (name: host: (builtins.substring 0 1 name) != "_") hosts);
in {
inherit (self)
packages;
nixosConfigurations = buildHosts self.nixosConfigurations;
iso = self.nixosConfigurations._iso.config.system.build.isoImage;
}

View File

@ -10,10 +10,7 @@ let
flake-helper = callLibs ./flake-helper.nix; flake-helper = callLibs ./flake-helper.nix;
inherit ("flake-helper") inherit ("flake-helper")
generateNixosSystem generateNixosSystem
mapToNixosConfigurations mapToNixosConfigurations;
generateColmenaHost
mapToColmenaHosts
buildHosts;
clerie-monitoring-ids = callLibs ./clerie-monitoring-ids.nix; clerie-monitoring-ids = callLibs ./clerie-monitoring-ids.nix;
}; };

View File

@ -11,6 +11,7 @@ rec {
in localNixpkgs.lib.nixosSystem { in localNixpkgs.lib.nixosSystem {
system = system; system = system;
modules = modules ++ [ modules = modules ++ [
self.nixosModules.clerie
({ ... }: { ({ ... }: {
/* /*
Make the contents of the flake availiable to modules. Make the contents of the flake availiable to modules.
@ -54,21 +55,4 @@ rec {
}; };
mapToNixosConfigurations = hosts: builtins.mapAttrs (name: host: generateNixosSystem host) hosts; mapToNixosConfigurations = hosts: builtins.mapAttrs (name: host: generateNixosSystem host) hosts;
generateColmenaHost = name: hostSystem: {
deployment = {
targetHost = hostSystem.config.networking.fqdn;
targetUser = null;
tags = let
group = nixpkgs.lib.attrByPath [ "clerie" "monitoring" "serviceLevel" ] null hostSystem.config;
in nixpkgs.lib.lists.optional (group != null) group;
};
nixpkgs.system = hostSystem.config.nixpkgs.system;
imports = hostSystem._module.args.modules;
deployment.allowLocalDeployment = builtins.any (n: n == name) [ "osmium" ];
};
mapToColmenaHosts = hosts: builtins.mapAttrs (generateColmenaHost) hosts;
buildHosts = hosts: builtins.mapAttrs (name: host: host.config.system.build.toplevel) (nixpkgs.lib.filterAttrs (name: host: (builtins.substring 0 1 name) != "_") hosts);
} }