diff options
| author | seth <[email protected]> | 2023-11-07 21:39:13 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-11-07 21:47:01 -0500 |
| commit | b7254760ccedc8fc81a21b4e707c628556df1f6c (patch) | |
| tree | 8a1b17a663e86cb9625c2fceddf0010c2cb2554c /test/lib | |
initial commit
Diffstat (limited to 'test/lib')
| -rw-r--r-- | test/lib/flake.lock | 42 | ||||
| -rw-r--r-- | test/lib/flake.nix | 48 |
2 files changed, 90 insertions, 0 deletions
diff --git a/test/lib/flake.lock b/test/lib/flake.lock new file mode 100644 index 0000000..a71eb72 --- /dev/null +++ b/test/lib/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "call-flake": { + "locked": { + "lastModified": 1699147280, + "narHash": "sha256-bmhE1TmrJG4ba93l9WQTLuYM53kwGQAjYHRvHOeuxWU=", + "owner": "divnix", + "repo": "call-flake", + "rev": "7d993ee93bd35a9e6574ec76d54b7d44087495ad", + "type": "github" + }, + "original": { + "owner": "divnix", + "repo": "call-flake", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1699099776, + "narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "call-flake": "call-flake", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} 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; + }; + }; +} |
