Compare commits
No commits in common. "e7775284350ae8cd848f6239011e915d6d61b81c" and "921076703628bb40e8227299532c7083e547be72" have entirely different histories.
e777528435
...
9210767036
@ -2,6 +2,8 @@
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../modules
|
||||
|
||||
./backup.nix
|
||||
./locale.nix
|
||||
./networking.nix
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
# Deployment
|
||||
bij
|
||||
colmena
|
||||
clerie-sops
|
||||
clerie-sops-edit
|
||||
sops
|
||||
|
14
flake.nix
14
flake.nix
@ -92,10 +92,11 @@
|
||||
|
||||
nixosConfigurations = helper.mapToNixosConfigurations self.clerie.hosts;
|
||||
|
||||
nixosModules = {
|
||||
clerie = import ./modules;
|
||||
default = self.nixosModules.clerie;
|
||||
colmena = {
|
||||
meta = {
|
||||
nixpkgs = localNixpkgs.x86_64-linux;
|
||||
};
|
||||
} // helper.mapToColmenaHosts self.nixosConfigurations;
|
||||
|
||||
overlays = {
|
||||
nixfilesInputs = import ./flake/overlay.nix inputs;
|
||||
@ -129,7 +130,12 @@
|
||||
|
||||
inherit lib self;
|
||||
|
||||
hydraJobs = import ./flake/hydraJobs.nix inputs;
|
||||
hydraJobs = {
|
||||
inherit (self)
|
||||
packages;
|
||||
nixosConfigurations = helper.buildHosts self.nixosConfigurations;
|
||||
iso = self.nixosConfigurations._iso.config.system.build.isoImage;
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-substituters = [
|
||||
|
@ -1,15 +0,0 @@
|
||||
{ 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;
|
||||
}
|
@ -10,7 +10,10 @@ let
|
||||
flake-helper = callLibs ./flake-helper.nix;
|
||||
inherit ("flake-helper")
|
||||
generateNixosSystem
|
||||
mapToNixosConfigurations;
|
||||
mapToNixosConfigurations
|
||||
generateColmenaHost
|
||||
mapToColmenaHosts
|
||||
buildHosts;
|
||||
clerie-monitoring-ids = callLibs ./clerie-monitoring-ids.nix;
|
||||
};
|
||||
|
||||
|
@ -11,7 +11,6 @@ rec {
|
||||
in localNixpkgs.lib.nixosSystem {
|
||||
system = system;
|
||||
modules = modules ++ [
|
||||
self.nixosModules.clerie
|
||||
({ ... }: {
|
||||
/*
|
||||
Make the contents of the flake availiable to modules.
|
||||
@ -55,4 +54,21 @@ 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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user