nix: remove subflake
This commit is contained in:
parent
5f5f399c8f
commit
203dad0703
16 changed files with 185 additions and 459 deletions
27
nix/static.nix
Normal file
27
nix/static.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
refraction,
|
||||
rust-overlay,
|
||||
pkgsCross,
|
||||
}: {arch}: let
|
||||
targets = with pkgsCross; {
|
||||
x86_64 = musl64.pkgsStatic;
|
||||
aarch64 = aarch64-multiplatform.pkgsStatic;
|
||||
};
|
||||
|
||||
getRustcTarget = pkgs: pkgs.stdenv.hostPlatform.rust.rustcTarget;
|
||||
toolchain = rust-overlay.rust.minimal.override {
|
||||
extensions = ["rust-std"];
|
||||
targets = lib.mapAttrsToList (lib.const getRustcTarget) targets;
|
||||
};
|
||||
|
||||
mkRustPlatformWith = pkgs:
|
||||
pkgs.makeRustPlatform (
|
||||
lib.genAttrs ["cargo" "rustc"] (lib.const toolchain)
|
||||
);
|
||||
rustPlatforms = lib.mapAttrs (lib.const mkRustPlatformWith) targets;
|
||||
in
|
||||
refraction.override {
|
||||
rustPlatform = rustPlatforms.${arch};
|
||||
optimizeSize = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue