-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
156 lines (141 loc) · 4.7 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
devenv.url = "github:cachix/devenv";
};
outputs = { self, nixpkgs, devenv, flake-utils, ... } @ inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
style50 = prev.python3.pkgs.buildPythonApplication
rec {
pname = "style50";
version = "2.9.0";
format = "setuptools";
src = prev.fetchPypi {
inherit pname version;
hash = "sha256-TIaBLa5cUTRAFHR7+uTL2legBHax2Bdugj6rYJsHsRw=";
};
doCheck = false;
propagatedBuildInputs =
with prev; [
icdiff
] ++
(with prev.python3.pkgs; [
setuptools
black
jsbeautifier
pycodestyle
magic
termcolor
jinja2
]);
};
presenterm = prev.rustPlatform.buildRustPackage
rec {
pname = "presenterm";
version = "0.2.1";
src = prev.fetchFromGitHub {
owner = "mfontanini";
repo = "presenterm";
rev = "v${version}";
hash = "sha256-sXVMVU34gxZKGNye6hoyv07a7N7f6UbivA6thbSOeZA=";
};
buildFeatures = [ "sixel" ];
nativeBuildInputs = with prev; [ makeWrapper ];
doCheck = false;
postInstall = ''
wrapProgram $out/bin/presenterm \
--prefix LD_LIBRARY_PATH : "${prev.lib.makeLibraryPath [ prev.libsixel ]}"
'';
cargoHash = "sha256-PsDaXMws/8hEvAZwClQ4okGuryg1iKg0IBr7Xp2QYBE=";
};
python3 = prev.python3 // {
pkgs = prev.python3.pkgs // {
python-cs50 = prev.python3.pkgs.buildPythonPackage rec {
pname = "cs50";
version = "9.3.0";
format = "setuptools";
src = prev.fetchPypi {
inherit pname version;
hash = "sha256-pRMECa0S1kpj/UNtMacLV1psxReXp7Ck1kgjVQrnYkg=";
};
propagatedBuildInputs =
with prev.python3.pkgs; [
flask
packaging
sqlalchemy
sqlparse
termcolor
wheel
];
doCheck = false;
};
};
};
})
];
};
in
{
devShells.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
languages.c.enable = true;
languages.rust.enable = true;
languages.python.enable = true;
packages = with pkgs; [
presenterm
valgrind
clang-tools
libcs50
style50
sqlite
nodePackages_latest.sql-formatter
] ++
(with pkgs.python3.pkgs; [
python-lsp-server
python-cs50
termcolor
pylint
black
isort
pytest
# HACK?
# propagatedBuildInputs of the python-cs50 libs are not part
# of the runtime path if these are not included
flask
packaging
sqlalchemy
sqlparse
termcolor
wheel
typing-extensions
# requirements for pset9/finance
flask-session
requests
pytz
urllib3
charset-normalizer
idna
certifi
cachelib
werkzeug
# requirements for cs50-python/pset4/emojize
emoji
# requirements for cs50-python/pset4/figlet
pyfiglet
# requirements for cs50-python/pset4/adieu
inflect
pydantic
]);
}
];
};
});
}