build: add statically linked output

if only something like this was possible with wayland and others...
This commit is contained in:
electria 2026-11-10 14:31:19 -08:00
commit 4ffe6c8d0f
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -22,21 +22,29 @@
cargoToml = fromTOML (builtins.readFile "${src}/Cargo.toml");
name = cargoToml.package.name;
bin = pkgs.rustPlatform.buildRustPackage {
inherit name src;
bin =
{
rustPlatform,
m4,
}:
rustPlatform.buildRustPackage {
inherit name src;
cargoLock.lockFile = "${src}/Cargo.lock";
cargoLock.lockFile = "${src}/Cargo.lock";
nativeBuildInputs = with pkgs; [
m4
];
};
nativeBuildInputs = [
m4
];
};
default = pkgs.callPackage bin { };
in
{
packages.default = bin;
packages.default = default;
packages.static = pkgs.pkgsStatic.callPackage bin { };
devShells.default = pkgs.mkShell {
inputsFrom = [ bin ];
inputsFrom = [ default ];
packages = with pkgs; [
clippy