-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
56 lines (54 loc) 路 1.53 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, flake-utils, ... } @ inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = with inputs; [
inputs.fenix.overlays.default
];
};
inherit (pkgs) fenix ra-flake;
inherit (pkgs.lib) importTOML;
# Rust toolchain
rustChannel = (importTOML ./rust-toolchain).toolchain.channel;
rustToolchain = fenix.toolchainOf {
channel = rustChannel;
sha256 = "sha256-gdYqng0y9iHYzYPAdkC/ka3DRny3La/S5G8ASj0Ayyc=";
};
# For development
rust-dev = fenix.combine (with rustToolchain; [
defaultToolchain
rust-src
rust-analyzer
]);
# For building packages
rust-minimal = rustToolchain.minimalToolchain;
rustPlatform = pkgs.makeRustPlatform {
cargo = rust-minimal;
rustc = rust-minimal;
};
in
{
packages.default = rustPlatform.buildRustPackage {
pname = "nerdfix";
version = "0.4.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
};
devShells.default = with pkgs; mkShell {
nativeBuildInputs = [
rust-dev
];
};
}
);
}