summaryrefslogtreecommitdiff
path: root/test/lib/flake.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-11-07 21:39:13 -0500
committerseth <[email protected]>2023-11-07 21:47:01 -0500
commitb7254760ccedc8fc81a21b4e707c628556df1f6c (patch)
tree8a1b17a663e86cb9625c2fceddf0010c2cb2554c /test/lib/flake.nix
initial commit
Diffstat (limited to 'test/lib/flake.nix')
-rw-r--r--test/lib/flake.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/lib/flake.nix b/test/lib/flake.nix
new file mode 100644
index 0000000..c4607dc
--- /dev/null
+++ b/test/lib/flake.nix
@@ -0,0 +1,48 @@
+{
+ inputs = {
+ nixpkgs.url = "nixpkgs/nixos-unstable";
+ call-flake.url = "github:divnix/call-flake";
+ };
+
+ outputs = {
+ self,
+ nixpkgs,
+ call-flake,
+ ...
+ }: let
+ inherit (nixpkgs) lib;
+
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
+
+ forAllSystems = fn: lib.genAttrs systems (sys: fn nixpkgs.legacyPackages.${sys});
+ workflow = (call-flake ../../.).lib {inherit self;};
+ in {
+ devShells = forAllSystems (pkgs: {
+ default = pkgs.mkShell {
+ packages = [pkgs.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
+ );
+ in {
+ matrix.include = jobs;
+ };
+ };
+}