summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-25 04:35:25 -0500
committerGitHub <[email protected]>2023-12-25 09:35:25 +0000
commitee728efb75096431bb94f746d990f2dc786b0be2 (patch)
tree2c8c01c29047985959c2f396c5fe0c4fe6644840 /test/lib
parentc28ea3d40d1136ae644d560bcceb20a89fb7d9ff (diff)
treewide!: support variable root outputs (#6)HEADmain
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/flake.nix39
1 files changed, 29 insertions, 10 deletions
diff --git a/test/lib/flake.nix b/test/lib/flake.nix
index c4607dc..985c421 100644
--- a/test/lib/flake.nix
+++ b/test/lib/flake.nix
@@ -19,8 +19,8 @@
"aarch64-darwin"
];
- forAllSystems = fn: lib.genAttrs systems (sys: fn nixpkgs.legacyPackages.${sys});
- workflow = (call-flake ../../.).lib {inherit self;};
+ forSystem = system: fn: fn nixpkgs.legacyPackages.${system};
+ forAllSystems = fn: lib.genAttrs systems (sys: forSystem sys fn);
in {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
@@ -28,21 +28,40 @@
};
});
+ flatPackages = forSystem "x86_64-linux" ({hello, ...}: {inherit hello;});
+
packages = forAllSystems (pkgs: {
inherit (pkgs) hello;
default = pkgs.hello;
});
- githubWorkflow = let
- outputs = ["packages" "devShells"];
- jobs = lib.concatLists (
- map (
- output: workflow.mkMatrix {inherit output;}
- )
- outputs
+ workflowMatrix = let
+ platforms = {
+ x86_64-linux = {
+ os = "ubuntu-latest";
+ arch = "x64";
+ };
+
+ aarch64-linux = {
+ os = "ubuntu-latest";
+ arch = "aarch64";
+ };
+ };
+
+ inherit ((call-flake ../../.).lib {inherit platforms;}) mkMatrix mkMatrix';
+
+ jobs = lib.flatten (
+ (mkMatrix' {
+ root = self;
+ output = "flatPackages";
+ })
+ ++ (mkMatrix {
+ root = self;
+ output = "packages";
+ })
);
in {
- matrix.include = jobs;
+ include = jobs;
};
};
}