From 34a7a042a36b63eb6b900932b1e420e4b6014a57 Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 5 May 2024 11:35:18 -0400 Subject: simplify some things (#353) * flake: drop flake-parts * flake: add back flake-parts * flake: use flake module again for configurations --- parts/ci.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 parts/ci.nix (limited to 'parts/ci.nix') diff --git a/parts/ci.nix b/parts/ci.nix new file mode 100644 index 0000000..5ddc81c --- /dev/null +++ b/parts/ci.nix @@ -0,0 +1,34 @@ +{self, ...}: { + perSystem = { + lib, + pkgs, + system, + self', + ... + }: { + packages = { + ciGate = let + toTopLevel = cfg: cfg.config.system.build.toplevel or cfg.activationPackage; + isCompatible = cfg: cfg.pkgs.system == system; + + configurations = + map + (type: + lib.mapAttrs (lib.const toTopLevel) + (lib.filterAttrs (lib.const isCompatible) self.${type})) + [ + "nixosConfigurations" + "darwinConfigurations" + "homeConfigurations" + ]; + + required = lib.concatMap lib.attrValues ( + lib.flatten [self'.checks self'.devShells configurations] + ); + in + pkgs.writeText "ci-gate" ( + lib.concatMapStringsSep "\n" toString required + ); + }; + }; +} -- cgit v1.2.3