nix: remove subflake

This commit is contained in:
seth 2024-04-30 18:03:34 -04:00 committed by Sefa Eyeoglu
parent 5f5f399c8f
commit 203dad0703
16 changed files with 185 additions and 459 deletions

27
nix/static.nix Normal file
View 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;
}