refactor(nix): reorganize flake
patchShebangs ./helper
'';
} // extraArgs);
- in
- {
- "${cargoToml.package.name}" = buildPackage pkgs { };
- "${cargoToml.package.name}-static" = buildPackage pkgs.pkgsStatic rec {
+ dynamicBin = buildPackage pkgs { };
+
+ staticBin = buildPackage pkgs.pkgsStatic
+ rec {
CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl";
CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER = with pkgs.pkgsMusl.stdenv; "${cc}/bin/${cc.targetPrefix}gcc";
meta.mainProgram = cargoToml.package.name;
};
- "${cargoToml.package.name}-docker" = pkgs.dockerTools.buildImage {
+ ociImage = pkgs.dockerTools.buildImage {
inherit (cargoToml.package) name;
tag = cargoToml.package.version;
runAsRoot = ''
- install -D "${self.packages.${system}."${cargoToml.package.name}-static"}/bin/${cargoToml.package.name}" "/bin/${cargoToml.package.name}"
+ install -D "${staticBin}/bin/${cargoToml.package.name}" "/bin/${cargoToml.package.name}"
'';
config.Cmd = [ cargoToml.package.name ];
config.Env = [ "PATH=/bin" ];
};
+ in
+ {
+ "${cargoToml.package.name}" = dynamicBin;
+ "${cargoToml.package.name}-static" = staticBin;
+ "${cargoToml.package.name}-docker" = ociImage;
};
devShell =
