nix: move dev outputs to subflake
This commit is contained in:
parent
3503dda44d
commit
921540e249
18 changed files with 461 additions and 331 deletions
41
nix/dev/static.nix
Normal file
41
nix/dev/static.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
perSystem = {
|
||||
lib,
|
||||
pkgs,
|
||||
inputs',
|
||||
refraction',
|
||||
...
|
||||
}: let
|
||||
targets = with pkgs.pkgsCross; {
|
||||
x86_64 = musl64.pkgsStatic;
|
||||
aarch64 = aarch64-multiplatform.pkgsStatic;
|
||||
};
|
||||
|
||||
toolchain = inputs'.rust-overlay.packages.rust.minimal.override {
|
||||
extensions = ["rust-std"];
|
||||
targets = map (pkgs: pkgs.stdenv.hostPlatform.config) (lib.attrValues targets);
|
||||
};
|
||||
|
||||
rustPlatforms =
|
||||
lib.mapAttrs (
|
||||
lib.const (pkgs:
|
||||
pkgs.makeRustPlatform (
|
||||
lib.genAttrs ["cargo" "rustc"] (lib.const toolchain)
|
||||
))
|
||||
)
|
||||
targets;
|
||||
|
||||
buildWith = rustPlatform:
|
||||
refraction'.packages.refraction.override {
|
||||
inherit rustPlatform;
|
||||
optimizeSize = true;
|
||||
};
|
||||
in {
|
||||
packages =
|
||||
lib.mapAttrs' (
|
||||
target: rustPlatform:
|
||||
lib.nameValuePair "refraction-static-${target}" (buildWith rustPlatform)
|
||||
)
|
||||
rustPlatforms;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue