From 6beb8db05a8ef717318186c72d10908eef8096be Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 13 May 2024 16:21:47 +0200 Subject: [PATCH] flake.nix: Move hydraJobs to seperate file --- flake.nix | 7 +------ flake/hydraJobs.nix | 15 +++++++++++++++ lib/default.nix | 3 +-- lib/flake-helper.nix | 2 -- 4 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 flake/hydraJobs.nix diff --git a/flake.nix b/flake.nix index 3fac2d4..7c178b5 100644 --- a/flake.nix +++ b/flake.nix @@ -124,12 +124,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 = [ diff --git a/flake/hydraJobs.nix b/flake/hydraJobs.nix new file mode 100644 index 0000000..017901b --- /dev/null +++ b/flake/hydraJobs.nix @@ -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; +} diff --git a/lib/default.nix b/lib/default.nix index d0ff32d..8d796fc 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -10,8 +10,7 @@ let flake-helper = callLibs ./flake-helper.nix; inherit ("flake-helper") generateNixosSystem - mapToNixosConfigurations - buildHosts; + mapToNixosConfigurations; clerie-monitoring-ids = callLibs ./clerie-monitoring-ids.nix; }; diff --git a/lib/flake-helper.nix b/lib/flake-helper.nix index eb78beb..146b889 100644 --- a/lib/flake-helper.nix +++ b/lib/flake-helper.nix @@ -54,6 +54,4 @@ rec { }; mapToNixosConfigurations = hosts: builtins.mapAttrs (name: host: generateNixosSystem host) hosts; - - buildHosts = hosts: builtins.mapAttrs (name: host: host.config.system.build.toplevel) (nixpkgs.lib.filterAttrs (name: host: (builtins.substring 0 1 name) != "_") hosts); }