-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
99 lines (84 loc) · 2.89 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
entry-crate = ./crates/argus-cli;
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
meta = (builtins.fromTOML (builtins.readFile (entry-crate/Cargo.toml))).package;
inherit (meta) name version;
depotjs = pkgs.rustPlatform.buildRustPackage rec {
pname = "depot";
version = "0.2.17";
# Depot tests require lots of external toolchains, node, typedoc, biome, ...
# so we'll just skip all tests for now and figure this out later.
doCheck = false;
src = pkgs.fetchFromGitHub {
owner = "cognitive-engineering-lab";
repo = pname;
rev = "v${version}";
hash = "sha256-kiQXxTVvzfovCn0YmOH/vTUQHyRS39gH7iBGaKyRZFg=";
};
cargoHash = "sha256-m9sG//vBUqGLwWHkyq+sJ8rkQOeaif56l394dgPU1uQ=";
buildInputs = with pkgs; lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
};
mdbook-image-size = with pkgs; rustPlatform.buildRustPackage rec {
pname = "mdbook-image-size";
version = "0.2.0";
src = fetchFromGitHub {
owner = "lhybdv";
repo = pname;
rev = version;
hash = "sha256-fySGDx3vbLsc3fL/54nMVjVRHNlQ2ZYSM4LMDHxUUvs=";
};
cargoHash = "sha256-iOTIjZr7vyduGTzK0xUssCKBKc8O0AYLpSdcozKPF2o=";
doCheck = false;
};
checkProject = pkgs.writeScriptBin "ci-check" ''
cargo fmt --check
cargo clippy
codespell .
cargo test
'';
in {
devShell = with pkgs; mkShell {
nativeBuildInputs = [ pkg-config ];
buildInputs = [
checkProject
llvmPackages_latest.llvm
llvmPackages_latest.lld
toolchain
guile
depotjs
nodejs_22
nodePackages.pnpm
codespell
cargo-make
cargo-watch
rust-analyzer
mdbook
mdbook-mermaid
mdbook-admonish
mdbook-image-size
vsce
cargo-workspaces
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
] ++ lib.optionals stdenv.isLinux [
alsa-lib.dev
udev.dev
];
RUSTC_LINKER = "${llvmPackages.clangUseLLVM}/bin/clang";
};
});
}