Compare commits

...
Author SHA1 Message Date
ff9befd9ee
build: add statically linked output
if only something like this was possible with wayland and others...
2026-11-10 14:31:19 -08:00
b4f0b81d9b
refactor: simplify devshell
inputFrom already inherits cargo and rustc
(from the rustPlatform used in the bin package)
2026-11-10 14:13:01 -08:00
f05eb164cd
refactor: rename derivation binding (crate -> bin) 2026-11-10 13:45:53 -08:00
8553f5efd9
build: optimize flake 2026-11-10 13:43:26 -08:00
2 changed files with 28 additions and 13 deletions

View file

@ -10,6 +10,9 @@ thiserror = "2.0.18"
version = "1.30"
default-features = false
features = ["std", "float"]
[dependencies.gmp-mpfr-sys]
version = "*"
features = ["force-cross"]
[profile.release]
lto = true

View file

@ -10,31 +10,43 @@
inputs.flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import inputs.nixpkgs { inherit system; };
pkgs = inputs.nixpkgs.legacyPackages.${system};
lib = inputs.nixpkgs.lib;
src = lib.sourceFilesBySuffices ./. [
"Cargo.toml"
"Cargo.lock"
".rs"
];
src = ./.;
cargoToml = fromTOML (builtins.readFile "${src}/Cargo.toml");
name = cargoToml.package.name;
crate = 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 = crate;
packages.default = default;
packages.static = pkgs.pkgsStatic.callPackage bin { };
devShells.default = pkgs.mkShell {
inputsFrom = [ crate ];
inputsFrom = [ default ];
packages = with pkgs; [
rustc
cargo
clippy
rustfmt
rust-analyzer