-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
58 lines (53 loc) · 1.64 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
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.inputs.nixpkgs.follows = "nixpkgs";
naersk.url = "github:nmattia/naersk";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, flake-utils, naersk }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
darwinInputs = pkgs.lib.optional pkgs.stdenv.isDarwin
[
pkgs.darwin.apple_sdk.frameworks.Security
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
];
in rec {
# `nix build`
packages.xbar-review-request-status = naersk-lib.buildPackage {
root = ./.;
buildInputs = [
pkgs.libiconv
pkgs.openssl
pkgs.pkg-config
pkgs.rustPackages.clippy
] ++ darwinInputs;
doCheck = true;
checkPhase = ''
cargo test
cargo clippy -- --deny warnings
'';
};
defaultPackage = packages.xbar-review-request-status;
overlay = final: prev: {
xbar-review-request-status = packages.xbar-review-request-status;
};
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs;
[
cargo
cargo-edit
cargo-insta
rustPackages.clippy
rustc
rustfmt
# for some reason this seems to be required, especially on macOS
libiconv
] ++ darwinInputs;
};
});
}