-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
55 lines (48 loc) · 1.51 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
{
description = "Auction Sniper in Rust";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, naersk, nixpkgs, flake-utils, flake-compat, fenix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
fenix-pkgs = fenix.packages.${system};
fenix-channel = fenix-pkgs.complete;
naersk-lib = naersk.lib."${system}".override {
inherit (fenix-pkgs.minimal) cargo rustc;
};
in rec {
packages.pariter = naersk-lib.buildPackage ./.;
defaultPackage = self.packages.${system}.pariter;
defaultApp = self.packages.${system}.pariter;
# `nix develop`
devShell = pkgs.mkShell
{
inputsFrom = builtins.attrValues self.packages.${system};
buildInputs = [ pkgs.libsodium pkgs.lzma pkgs.openssl ];
nativeBuildInputs = (with pkgs;
[
pkgconfig
gnuplot
fenix-pkgs.rust-analyzer
fenix-channel.rustfmt
fenix-channel.rustc
]);
RUST_SRC_PATH = "${fenix-channel.rust-src}/lib/rustlib/src/rust/library";
};
});
}