-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
46 lines (35 loc) · 1.32 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
{
inputs = {
naersk.url = "github:nix-community/naersk";
fenix.url = "github:nix-community/fenix";
naersk.inputs.nixpkgs.follows = "fenix/nixpkgs";
nixpkgs.follows = "fenix/nixpkgs";
utils.url = "github:numtide/flake-utils";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
};
outputs = args@{ self, nixpkgs, utils, fenix, naersk, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
fenixArch = fenix.packages.${system};
rustChannel = fenixArch.stable;
rustToolchain = rustChannel.withComponents [ "cargo" "clippy" "rust-src" "rust-std" "rustc" "rustfmt" ];
naersk-lib = naersk.lib.${system}.override {
cargo = rustToolchain;
rustc = rustToolchain;
};
in rec {
inherit rustToolchain;
defaultPackage = naersk-lib.buildPackage ./.;
defaultApp = {
type = "app";
program = "${self.defaultPackage."${system}"}/bin/wg-bond";
};
devShell = with pkgs; mkShell {
buildInputs = [ xlibs.libX11 rustToolchain pre-commit ];
nativeBuildInputs = [ pkg-config ];
LD_LIBRARY_PATH = lib.makeLibraryPath [ xlibs.libXcursor xlibs.libXrandr xlibs.libXi libGL ];
};
});
}