From b7254760ccedc8fc81a21b4e707c628556df1f6c Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 7 Nov 2023 21:39:13 -0500 Subject: initial commit --- test/lib/flake.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 test/lib/flake.nix (limited to 'test/lib/flake.nix') 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; + }; + }; +} -- cgit v1.2.3