From cdeb7d50f232103294a2bb36525a6d9f552fb4ed Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 6 Apr 2024 22:08:07 -0400 Subject: separate everything from flake.nix again --- ci.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ci.nix (limited to 'ci.nix') diff --git a/ci.nix b/ci.nix new file mode 100644 index 0000000..f3ec82a --- /dev/null +++ b/ci.nix @@ -0,0 +1,32 @@ +{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