-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathshell.nix
More file actions
52 lines (50 loc) · 1.12 KB
/
shell.nix
File metadata and controls
52 lines (50 loc) · 1.12 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
{
system ? builtins.currentSystem,
}:
let
pins = import ./npins;
pkgs = import pins.nixpkgs { inherit system; };
inherit (pkgs) stdenv lib;
pre-commit = (import pins."pre-commit-hooks.nix").run {
src = ./.;
hooks = {
nixfmt-rfc-style = {
enable = true;
settings.width = 100;
};
rustfmt.enable = true;
update-readme = {
enable = true;
files = "((^README\\.md\\.in|^README\\.md|^readme\\.nix|^Cargo\\.toml)|\\.rs)$";
entry = toString (
pkgs.writeShellScript "update-readme" ''
${pkgs.nix}/bin/nix-build ${toString ./readme.nix} -o readme && cp readme README.md
exec ${pkgs.git}/bin/git diff --quiet --exit-code -- README.md
''
);
};
};
};
in
pkgs.mkShell {
nativeBuildInputs =
with pkgs;
[
cargo
cargo-expand
clippy
rustc
rust-analyzer
rustfmt
nixfmt-rfc-style
lix
nix-prefetch-git
nix-prefetch-docker
git
npins
]
++ (lib.optionals stdenv.isDarwin [
pkgs.libiconv
]);
inherit (pre-commit) shellHook;
}