From 3067b8332e58f4e253d9d8692894c078e4e3e091 Mon Sep 17 00:00:00 2001 From: uku Date: Sun, 24 Dec 2023 18:38:43 +0100 Subject: [PATCH] add packages from overlay --- ci.nix | 45 +++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 1 + 2 files changed, 46 insertions(+) create mode 100644 ci.nix diff --git a/ci.nix b/ci.nix new file mode 100644 index 0000000..64525f2 --- /dev/null +++ b/ci.nix @@ -0,0 +1,45 @@ +{ + self, + inputs, + ... +}: { + perSystem = { + lib, + pkgs, + system, + ... + }: { + packages = let + overlay = lib.fix (final: (import ./exprs/overlay.nix final pkgs)); + + # do not include a package if it's not available on the system or if it's broken + isValid = _: v: + lib.elem pkgs.system (v.meta.platforms or [pkgs.system]) && !(v.meta.broken or false); + in + lib.filterAttrs isValid overlay; + }; + + flake.ghaMatrix.include = let + inherit (inputs.nixpkgs) lib; + + platforms = { + "x86_64-linux" = { + os = "ubuntu-latest"; + }; + }; + in + lib.pipe platforms [ + builtins.attrNames # get systems + (systems: lib.getAttrs systems self.packages) # get packages of each system + (lib.mapAttrs (_: builtins.attrNames)) # keep only the name of each package + + # map each package in each system to an attrset + (lib.mapAttrsToList (system: + builtins.map (pkg: { + inherit (platforms.${system}) os; + pkg = "packages.${system}.${pkg}"; + }))) + + lib.flatten + ]; +} diff --git a/flake.nix b/flake.nix index 1d7ddce..6e8ca1a 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,7 @@ systems = ["x86_64-linux"]; imports = [ + ./ci.nix ./dev.nix ./systems ];