|
|
|
@ -1,15 +1,11 @@
|
|
|
|
|
{
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs";
|
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
|
naersk = {
|
|
|
|
|
url = "github:nix-community/naersk";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
|
|
|
|
fenix = {
|
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs = {
|
|
|
|
@ -17,21 +13,11 @@
|
|
|
|
|
nixpkgs,
|
|
|
|
|
utils,
|
|
|
|
|
naersk,
|
|
|
|
|
fenix,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
utils.lib.eachDefaultSystem (system: let
|
|
|
|
|
pkgs = nixpkgs.legacyPackages."${system}";
|
|
|
|
|
toolchain = with fenix.packages."${system}";
|
|
|
|
|
combine [
|
|
|
|
|
minimal.rustc
|
|
|
|
|
minimal.cargo
|
|
|
|
|
targets.x86_64-pc-windows-gnu.latest.rust-std
|
|
|
|
|
targets.x86_64-unknown-linux-gnu.latest.rust-std
|
|
|
|
|
];
|
|
|
|
|
naersk-lib = naersk.lib."${system}".override {
|
|
|
|
|
cargo = toolchain;
|
|
|
|
|
rustc = toolchain;
|
|
|
|
|
};
|
|
|
|
|
naersk-lib = naersk.lib."${system}";
|
|
|
|
|
in rec
|
|
|
|
|
{
|
|
|
|
|
packages.malachite = naersk-lib.buildPackage {
|
|
|
|
@ -39,32 +25,9 @@
|
|
|
|
|
root = ./.;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
packages.malachite-win = naersk-lib.buildPackage {
|
|
|
|
|
pname = "Malachite";
|
|
|
|
|
root = ./.;
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
depsBuildBuild = with pkgs; [
|
|
|
|
|
pkgsCross.mingwW64.stdenv.cc
|
|
|
|
|
pkgsCross.mingwW64.windows.pthreads
|
|
|
|
|
];
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
|
(
|
|
|
|
|
if system == "x86_64-linux"
|
|
|
|
|
then wineWowPackages.stable
|
|
|
|
|
else hello
|
|
|
|
|
)
|
|
|
|
|
];
|
|
|
|
|
CARGO_BUILD_TARGET = "x86_64-pc-windows-gnu";
|
|
|
|
|
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUNNER = pkgs.writeScript "wine-wrapper" ''
|
|
|
|
|
export WINEPREFIX="$(mktemp -d)"
|
|
|
|
|
exec wine64 $@
|
|
|
|
|
'';
|
|
|
|
|
doCheck = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
packages.default = packages.malachite;
|
|
|
|
|
|
|
|
|
|
apps.apod = utils.lib.mkApp {
|
|
|
|
|
apps.malachite = utils.lib.mkApp {
|
|
|
|
|
drv = packages.malachite;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -77,7 +40,15 @@
|
|
|
|
|
cargo-audit
|
|
|
|
|
rustfmt
|
|
|
|
|
clippy
|
|
|
|
|
rust-analyzer
|
|
|
|
|
|
|
|
|
|
# For `alpm` libs
|
|
|
|
|
pkg-config
|
|
|
|
|
pacman
|
|
|
|
|
openssl
|
|
|
|
|
];
|
|
|
|
|
# For rust-analyzer
|
|
|
|
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
formatter = pkgs.alejandra;
|
|
|
|
|