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 = [
../../modules
./backup.nix
./locale.nix
./networking.nix

View File

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

View File

@ -92,11 +92,10 @@
nixosConfigurations = helper.mapToNixosConfigurations self.clerie.hosts;
colmena = {
meta = {
nixpkgs = localNixpkgs.x86_64-linux;
nixosModules = {
clerie = import ./modules;
default = self.nixosModules.clerie;
};
} // helper.mapToColmenaHosts self.nixosConfigurations;
overlays = {
nixfilesInputs = import ./flake/overlay.nix inputs;
@ -130,12 +129,7 @@
inherit lib self;
hydraJobs = {
inherit (self)
packages;
nixosConfigurations = helper.buildHosts self.nixosConfigurations;
iso = self.nixosConfigurations._iso.config.system.build.isoImage;
};
hydraJobs = import ./flake/hydraJobs.nix inputs;
nixConfig = {
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;
inherit ("flake-helper")
generateNixosSystem
mapToNixosConfigurations
generateColmenaHost
mapToColmenaHosts
buildHosts;
mapToNixosConfigurations;
clerie-monitoring-ids = callLibs ./clerie-monitoring-ids.nix;
};

View File

@ -11,6 +11,7 @@ rec {
in localNixpkgs.lib.nixosSystem {
system = system;
modules = modules ++ [
self.nixosModules.clerie
({ ... }: {
/*
Make the contents of the flake availiable to modules.
@ -54,21 +55,4 @@ rec {
};
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);
}