-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
110 lines (93 loc) · 2.66 KB
/
Copy pathflake.nix
File metadata and controls
110 lines (93 loc) · 2.66 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
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
100
101
102
103
104
105
106
107
108
109
110
# vim:fileencoding=utf-8:foldmethod=marker
#: Tip: If you are using (n)vim, you can press zM to fold all the config blocks quickly (za to fold under cursor)
#: Tip: search keywords to start quickly
{
#: Inputs {{{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
blackbox.url = "github:cubewhy/blackbox-flakes";
#: Do not forget to modify the `overlays` variable below after you added new overlays
rust-overlay.url = "github:oxalica/rust-overlay";
};
#: inputs end }}}
outputs = {
self,
blackbox,
rust-overlay,
nixpkgs,
...
}: let
#: Overlays {{{
overlays = [
(import rust-overlay)
];
#: overlays end }}}
in {
devShells =
blackbox.lib.eachSystem {
inherit nixpkgs overlays;
} (pkgs: {
default = blackbox.lib.mkShell {
inherit pkgs;
#: Config {{{
config = {
#: Languages {{{
#: Rust {{{
blackbox.languages.rust = {
enable = true;
toolchainFile = ./rust-toolchain.toml;
};
#: rust end }}}
blackbox.languages.javascript = {
enable = true;
manager = "pnpm";
};
# blackbox.languages.java = {
# enable = true;
# };
#: languages end }}}
#: Libraries {{{
blackbox.libraries = {
#: OpenSSL {{{
openssl.enable = false;
#: openssl end }}}
#: shared libraries {{{
#: blackbox-flake will config LD_LIBRARY_PATH and LIBRARY_PATH for the following packages
shared = with pkgs; [
# alsa-lib
# pipewire
# libpulseaudio
];
#: }}}
};
#: libraries end }}}
#: Tools {{{
blackbox.tools = {
#: Pre-commit {{{
pre-commit = {
enable = true;
#: Force run `pre-commit install` when enter shell
#: This is not recommended, please don't enable it.
runOnStart = false;
};
#: pre-commit end }}}
};
#: tools end }}}
};
#: config end }}}
#: Custom options {{{
#: mkShell builtin options are available
# shellHook = ''
# '';
buildInputs = [pkgs.jdk17];
env = {
JAVA_HOME = pkgs.jdk17.home;
};
packages = with pkgs; [
cargo-insta
];
#: custom options end }}}
};
});
};
}