chore: cleanup + update nix flake

This commit is contained in:
seth 2024-01-27 23:49:35 -05:00
parent f4fa737124
commit 24c8406590
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
6 changed files with 91 additions and 109 deletions

View file

@ -14,7 +14,7 @@
...
}: let
crossPkgsFor =
rec {
{
x86_64-linux = {
x86_64 = pkgs.pkgsStatic;
aarch64 = pkgs.pkgsCross.aarch64-multiplatform.pkgsStatic;
@ -30,7 +30,7 @@
aarch64 = pkgs.pkgsCross.aarch64-multiplatform.pkgsStatic;
};
aarch64-darwin = x86_64-darwin;
aarch64-darwin = crossPkgsFor.x86_64-darwin;
}
.${system};
@ -56,17 +56,17 @@
optimizeSize = true;
};
newAttrs = lib.fix (finalAttrs: {
newAttrs = {
CARGO_BUILD_TARGET = target;
"CC_${target'}" = "${cc}/bin/${cc.targetPrefix}cc";
"CARGO_TARGET_${targetUpper}_RUSTFLAGS" = "-C target-feature=+crt-static";
"CARGO_TARGET_${targetUpper}_LINKER" = finalAttrs."CC_${target'}";
});
"CARGO_TARGET_${targetUpper}_LINKER" = newAttrs."CC_${target'}";
};
inherit (crossPkgsFor.${arch}.stdenv) cc;
in
lib.getExe (
refraction.overrideAttrs (_: newAttrs)
refraction.overrideAttrs (lib.const newAttrs)
);
containerFor = arch: