-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
59 lines (57 loc) · 1.61 KB
/
flake.nix
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
55
56
57
58
59
{
description = "An x7 interpreter in Rust";
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
fenix,
nixpkgs,
}: let
supportedSystems = nixpkgs.lib.systems.flakeExposed;
allSystems = output:
nixpkgs.lib.genAttrs supportedSystems
(system: output nixpkgs.legacyPackages.${system});
in {
packages = allSystems (pkgs: {
default = pkgs.rustPlatform.buildRustPackage {
pname = "rx7";
version = "0.1.0";
src = self;
cargoLock.lockFile = ./Cargo.lock;
};
});
devShells = allSystems (pkgs: let
pkgsFenix = fenix.packages.${pkgs.system};
stable = pkgsFenix.toolchainOf {
channel = "1.80.0";
sha256 = "sha256-6eN/GKzjVSjEhGO9FhWObkRFaE1Jf+uqMSdQnb8lcB4=";
};
nightly = pkgsFenix.latest; # If you use multiple nightly components, you may want to change this to `pkgsFenix.complete` to reduce the risk of incompatibility.
rustPackages = pkgsFenix.combine [
(stable.withComponents [
"cargo"
"clippy"
"rustc" # includes rust-std
#"miri"
#"rust-src" # rust stdlib source code. used by rust-analyzer and miri
])
nightly.rustfmt
];
in {
default = pkgs.mkShell {
inherit
(self.outputs.packages.${pkgs.system}.default)
nativeBuildInputs
buildInputs
;
packages = [rustPackages];
RUST_BACKTRACE = 1;
};
});
};
}