From d4056c82bca16648e030e71dac152b01981d9f29 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 14 Jul 2024 11:13:08 +0800 Subject: [PATCH] wrapper-manager-fds: put more things in flake --- LICENSE | 4 ++++ flake.nix | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index ce20b53..f665d88 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,9 @@ Copyright (c) 2024 Gabriel Arazas +Program uses the following files/implementations from other authors; +see their respective license headers for more details: +flake.nix, specifically the eachSystem which is taken directly from flake-utils: Copyright (c) 2020 zimbatm + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights diff --git a/flake.nix b/flake.nix index aa593c4..f1d241f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,4 +1,38 @@ { description = "wrapper-manager-fds flake"; - outputs = { ... }: import ./. { }; + outputs = { ... }: let + sources = import ./npins; + systems = [ "x86_64-linux" "aarch64-linux" ]; + eachSystem = systems: f: + let + # Merge together the outputs for all systems. + op = attrs: system: + let + ret = f system; + op = attrs: key: attrs // + { + ${key} = (attrs.${key} or { }) + // { ${system} = ret.${key}; }; + } + ; + in + builtins.foldl' op attrs (builtins.attrNames ret); + in + builtins.foldl' op { } + (systems + ++ # add the current system if --impure is used + (if builtins?currentSystem then + if builtins.elem builtins.currentSystem systems + then [] + else [ builtins.currentSystem ] + else + [])); + in import ./. { } // (eachSystem systems (system: let + pkgs = import sources.nixos-unstable { inherit system; }; + tests = import ./tests { inherit pkgs; }; + in { + devShells.default = import ./shell.nix { inherit pkgs; }; + + checks.wrapperManagerLibrarySetPkg = tests.libTestPkg; + })); }