-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
100 lines (91 loc) · 2.63 KB
/
flake.nix
File metadata and controls
100 lines (91 loc) · 2.63 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
{
description = "An example project using flutter";
inputs.nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable";
};
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
config.android_sdk.accept_license = true;
};
pythonEnv = pkgs.python313.withPackages (ps: [
ps.pip
ps.virtualenv
ps.pygments
ps.jupyter
ps.ipykernel
ps.notebook
ps.pymssql
ps.pytest
]);
tex = (pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-full
latexmk;
});
in {
devShells.default = pkgs.mkShell.override {stdenv = pkgs.llvmPackages_21.stdenv;} {
buildInputs = with pkgs; [
(pkgs.vscode-with-extensions.override {
vscode = pkgs.vscode-fhs;
vscodeExtensions = with pkgs.vscode-extensions; [
ms-python.python
ms-python.vscode-pylance
ms-toolsai.jupyter
anthropic.claude-code
ms-vscode.cpptools
asvetliakov.vscode-neovim
];
})
pythonEnv
antlr
cmake
zlib
zlib.dev
gdb
perf
perl
tex
plantuml
inkscape
llvmPackages_21.llvm
llvmPackages_21.llvm.dev
nodejs_20
graphviz
];
nativeBuildInputs = [
pkgs.clang-tools
];
NIX_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.stdenv.cc.cc
pkgs.zlib
pkgs.zlib.dev
];
NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
shellHook = ''
export VENV_DIR="$PWD/.venv"
if [ ! -d "$VENV_DIR" ]; then
${pythonEnv}/bin/python -m venv $VENV_DIR
source $VENV_DIR/bin/activate
pip install pip setuptools wheel
else
source $VENV_DIR/bin/activate
fi
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
export PYTHONPATH="${pythonEnv}/lib/python3.13/site-packages:$PYTHONPATH"
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
python -m ipykernel install --user --name iu9-sql-compiler --display-name "Python (iu9-sql-compiler)"
python --version
'';
};
});
}