Fixes to Nix flake

main
Michal S 2 years ago
parent 60667232e5
commit a6d6ee2d8d

@ -1,26 +1,5 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1658644019,
"narHash": "sha256-P4ZEkrJSvtiBVnXZUagg6QtiVRc6k9XgTbWLZ7Q73Ow=",
"owner": "nix-community",
"repo": "fenix",
"rev": "a844a251dcd8aac45d47a81adae6117ff4f57b8d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": [
@ -43,45 +22,26 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1658644204,
"narHash": "sha256-MWyfCH9K3eVTXJUxBi67OQSAh9jJAnvWklM6qm4j8w8=",
"lastModified": 1664281702,
"narHash": "sha256-haixZ4TJLu1Dciow54wrHrHvlGDVr5sW6MTeAV/ZLuI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2f0c3be57c348f4cfd8820f2d189e29a685d9c41",
"rev": "7e52b35fe98481a279d89f9c145f8076d049d2b9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"fenix": "fenix",
"naersk": "naersk",
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1658612252,
"narHash": "sha256-mO2M5pgrkxjSURWILT91w+ChkQ3mU+oOpdxF+yFaBEc=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "977e12a0bdc3e329af179ef3a9d466af9eb613bb",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1656928814,

@ -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,9 +40,17 @@
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;
});
}
}
Loading…
Cancel
Save