From 98e9edac4c79a6f4f723db9df79adf99ac3ffb51 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 8 Feb 2024 21:20:33 -0500 Subject: lib/ci: init --- lib/ci.nix | 6 ++++++ repo/ci.nix | 10 +++------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 lib/ci.nix diff --git a/lib/ci.nix b/lib/ci.nix new file mode 100644 index 0000000..7a01e39 --- /dev/null +++ b/lib/ci.nix @@ -0,0 +1,6 @@ +{lib, ...}: ciSystems: { + getOutputs = lib.getAttrs ciSystems; + + mapCfgsToDerivs = lib.mapAttrs (_: cfg: cfg.activationPackage or cfg.config.system.build.toplevel); + getCompatibleCfgs = lib.filterAttrs (_: cfg: lib.elem cfg.pkgs.system ciSystems); +} diff --git a/repo/ci.nix b/repo/ci.nix index e33c088..8538d28 100644 --- a/repo/ci.nix +++ b/repo/ci.nix @@ -5,24 +5,20 @@ }: { flake.hydraJobs = let ciSystems = ["x86_64-linux"]; - - getOutputs = lib.getAttrs ciSystems; - - mapCfgsToDerivs = lib.mapAttrs (_: cfg: cfg.activationPackage or cfg.config.system.build.toplevel); - getCompatibleCfgs = lib.filterAttrs (_: cfg: lib.elem cfg.pkgs.system ciSystems); + ci = self.lib.ci ciSystems; in builtins.foldl' lib.recursiveUpdate {} [ ( lib.genAttrs ["nixosConfigurations" "homeConfigurations"] ( - type: mapCfgsToDerivs (getCompatibleCfgs self."${type}") + type: ci.mapCfgsToDerivs (ci.getCompatibleCfgs self."${type}") ) ) ( lib.genAttrs ["checks" "devShells"] - (type: getOutputs self.${type}) + (type: ci.getOutputs self.${type}) ) ]; } -- cgit v1.2.3