diff options
Diffstat (limited to 'test/lib/flake.nix')
| -rw-r--r-- | test/lib/flake.nix | 48 |
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; + }; + }; +} |
