diff options
| author | seth <[email protected]> | 2024-07-06 04:10:27 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-07-06 04:10:27 -0400 |
| commit | cdb32dbd1810fbafc3b80bf6693e0f8dcf81b2c2 (patch) | |
| tree | 6e580008869ef4cd64f619f8740712c42e5d50b1 /nix/static.nix | |
| parent | c61a7b372a1ec99ec8d490c7f96df3a25a5c2281 (diff) | |
tree-wide: start using treefmt (#17)
* nix: alejandra -> nixfmt
* nix: simplify flake
* nix: drop flake-checks
* tree-wide: start using treefmt
Diffstat (limited to 'nix/static.nix')
| -rw-r--r-- | nix/static.nix | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/nix/static.nix b/nix/static.nix index c5e3c57..86a1cc3 100644 --- a/nix/static.nix +++ b/nix/static.nix @@ -3,33 +3,43 @@ fenix, pkgsCross, nixpkgs-tracker-bot, -}: let +}: +let crossPkgsFor = with pkgsCross; { x86_64 = musl64.pkgsStatic; aarch64 = aarch64-multiplatform; }; - rustcTargetFor = lib.mapAttrs (lib.const (pkgs: pkgs.stdenv.hostPlatform.rust.rustcTarget)) crossPkgsFor; - rustStdFor = lib.mapAttrs (lib.const (rustcTarget: fenix.targets.${rustcTarget}.stable.rust-std)) rustcTargetFor; + rustcTargetFor = lib.mapAttrs (lib.const ( + pkgs: pkgs.stdenv.hostPlatform.rust.rustcTarget + )) crossPkgsFor; + rustStdFor = lib.mapAttrs (lib.const ( + rustcTarget: fenix.targets.${rustcTarget}.stable.rust-std + )) rustcTargetFor; - toolchain = with fenix; + toolchain = + with fenix; combine ( - [stable.cargo stable.rustc] + [ + stable.cargo + stable.rustc + ] ++ lib.attrValues rustStdFor ); - crossPlatformFor = - lib.mapAttrs ( - lib.const (pkgs: - pkgs.makeRustPlatform ( - lib.genAttrs ["cargo" "rustc"] (lib.const toolchain) - )) + crossPlatformFor = lib.mapAttrs (lib.const ( + pkgs: + pkgs.makeRustPlatform ( + lib.genAttrs [ + "cargo" + "rustc" + ] (lib.const toolchain) ) - crossPkgsFor; + )) crossPkgsFor; in - {arch}: - nixpkgs-tracker-bot.override { - rustPlatform = crossPlatformFor.${arch}; - inherit (crossPkgsFor.${arch}) openssl; - optimizeSize = true; - } +{ arch }: +nixpkgs-tracker-bot.override { + rustPlatform = crossPlatformFor.${arch}; + inherit (crossPkgsFor.${arch}) openssl; + optimizeSize = true; +} |
