-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
50 lines (40 loc) · 962 Bytes
/
shell.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
let
pkgs = import <nixpkgs> { };
# CoC Config
cocConfig = pkgs.writeText "coc-settings.json" (
builtins.toJSON {
"texlab.path" = "${pkgs.texlab}/bin/texlab";
}
);
PROJECT_ROOT = builtins.getEnv "PWD";
in
with pkgs;
mkShell {
name = "impurePythonEnv";
venvDir = "./.venv";
# https://e.printstacktrace.blog/merging-json-files-recursively-in-the-command-line/
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
mkdir -p .vim
ln -sf ${cocConfig} ${PROJECT_ROOT}/.vim/coc-settings.json
# Add /bin to path
export PATH="${PROJECT_ROOT}/bin:$PATH"
'';
buildInputs = [
python3
python3Packages.venvShellHook
# Core
gnumake
neovim
ripgrep
rnix-lsp
# LaTeX
python3Packages.pygments
texlive.combined.scheme-full
];
# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
'';
}