forked from Pumpkin-MC/Pumpkin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
54 lines (50 loc) · 1.48 KB
/
Copy pathflake.nix
File metadata and controls
54 lines (50 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = nixpkgs.lib.systems.flakeExposed;
perSystem = {
pkgs,
system,
...
}:
let
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
manifest = (pkgs.lib.importTOML ./pumpkin/Cargo.toml).package;
in
{
formatter = pkgs.nixfmt-rfc-style;
_module.args.pkgs = import nixpkgs {
inherit system;
overlays = [
(import inputs.rust-overlay)
];
};
devShells.default = pkgs.mkShell
{
nativeBuildInputs = with pkgs; [
(rustToolchain.override {
extensions = ["rust-src"];
})
pkg-config
];
};
packages.default = (pkgs.makeRustPlatform {rustc = rustToolchain; cargo = rustToolchain;}).buildRustPackage {
pname = manifest.name;
version = manifest.version;
useFetchCargoVendor = true;
cargoLock = {
lockFile = ./Cargo.lock;
};
};
};
};
}