-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
52 lines (49 loc) · 1.33 KB
/
flake.nix
File metadata and controls
52 lines (49 loc) · 1.33 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
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
fenix,
}:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
fenixPkgs = fenix.packages.${system};
rustToolChain = fenixPkgs.combine [
fenixPkgs.stable.minimalToolchain
fenixPkgs.stable.rustfmt
fenixPkgs.stable.clippy
fenixPkgs.stable.rust-src
];
in
{
packages.${system}.default = pkgs.rustPlatform.buildRustPackage {
pname = "scoreman";
version = "1.0.0";
cargoHash = "sha256-A/248fXOHCvNov44PUrGgMqwb9e4SUVok4Do67/or9Q=";
src = ./.;
};
devShells.${system}.default = pkgs.mkShell {
shellHook = ''
# https://github.com/NixOS/nix/issues/8034#issuecomment-2046069655
FLAKE_ROOT="$(git rev-parse --show-toplevel)"
rm -f $FLAKE_ROOT/.rust-toolchain && ln -s ${rustToolChain} $FLAKE_ROOT/.rust-toolchain
'';
nativeBuildInputs = [
pkgs.samply
pkgs.valgrind
pkgs.mold-wrapped
pkgs.kcachegrind
rustToolChain
];
};
};
}