diff options
| author | seth <[email protected]> | 2024-07-04 16:00:23 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-07-04 16:11:35 -0400 |
| commit | ab84656f19fe2bd7053d54d6eee60aa3efa8898b (patch) | |
| tree | 88ec487207cb4bb6fdb6362ea8b71f2ee477926f | |
| parent | 72ef396c60318d08ab6c30f4b198941f1cc37e6f (diff) | |
nix: simplify forAllSystems
| -rw-r--r-- | flake.nix | 33 |
1 files changed, 18 insertions, 15 deletions
@@ -13,6 +13,7 @@ flake-checks, }: let + inherit (nixpkgs) lib; systems = [ "x86_64-linux" "aarch64-linux" @@ -20,15 +21,16 @@ "aarch64-darwin" ]; - forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system}); + forAllSystems = lib.genAttrs systems; + nixpkgsFor = forAllSystems (system: nixpkgs.legacyPackages.${system}); in { checks = forAllSystems ( - pkgs: + system: let flake-checks' = flake-checks.lib.mkChecks { root = ./.; - inherit pkgs; + pkgs = nixpkgsFor.${system}; }; in { @@ -41,22 +43,23 @@ } ); - devShells = forAllSystems ( - { pkgs, system, ... }: - { - default = import ./shell.nix { - inherit pkgs system; - formatter = self.formatter.${system}; - }; - } - ); + devShells = forAllSystems (system: { + default = import ./shell.nix { + inherit system; + pkgs = nixpkgsFor.${system}; + formatter = self.formatter.${system}; + }; + }); - formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style); + formatter = forAllSystems (system: nixpkgsFor.${system}.nixfmt-rfc-style); packages = forAllSystems ( - { pkgs, system, ... }: + system: let - pkgs' = import ./. { inherit pkgs system; }; + pkgs' = import ./. { + inherit system; + pkgs = nixpkgsFor.${system}; + }; in pkgs' // { default = pkgs'.website; } ); |
