CMU Coding Bootcamp
1# SPDX-FileCopyrightText: 2025 FreshlyBakedCake
2#
3# SPDX-License-Identifier: MIT
4
5let
6 pins = import ./npins;
7
8 nilla = import pins.nilla;
9in
10nilla.create (
11 { config, lib }:
12 {
13 config = {
14 inputs = {
15 nixpkgs = {
16 src = pins.nixpkgs;
17 };
18 };
19 packages.cmu-graphics = {
20 systems = [ "x86_64-linux" ];
21 package =
22 {
23 pkgs,
24 python313,
25 fetchPypi,
26 }:
27 let
28 pname = "cmu_graphics";
29 version = "1.1.43";
30 in
31 python313.pkgs.buildPythonPackage {
32 inherit pname version;
33
34 src = fetchPypi {
35 inherit pname version;
36 hash = "sha256-IU6z+4xB7Uz/SsIrFkFRfLL10ZmpQTPyK+yDWDq89Xs=";
37 };
38
39 doCheck = false;
40 checkPhase = ''
41 true
42 '';
43 dontCheckPythonPackages = true;
44 pyproject = true;
45
46 dependencies = [
47 python313.pkgs.pycairo
48 python313.pkgs.pygame
49 ];
50
51 build-system = [
52 python313.pkgs.setuptools
53 python313.pkgs.wheel
54 pkgs.pre-commit
55 ];
56 };
57 };
58 shells.default = config.shells.blog;
59 shells.python = {
60 # Declare what systems the shell can be used on.
61 systems = [ "x86_64-linux" ];
62
63 # Define our shell environment.
64 shell =
65 {
66 pkgs,
67 mkShell,
68 ...
69 }:
70 let
71 python3 = pkgs.python313.override {
72 packageOverrides = pyfinal: pyprev: {
73 cmu_graphics = config.packages.cmu-graphics.result.x86_64-linux;
74 };
75 };
76 in
77 mkShell {
78 shellHook = ''
79 [ "$(hostname)" = "shorthair" ] && export ZED_PREDICT_EDITS_URL=http://localhost:9000/predict_edits
80 '';
81 packages = [
82 (python3.withPackages (ppkgs: [
83 ppkgs.pandas
84 ppkgs.pandas-stubs
85 ppkgs.matplotlib
86 ppkgs.seaborn
87 ppkgs.numpy
88 ppkgs.requests
89 ppkgs.geopy
90 ppkgs.cmu_graphics
91 ppkgs.pycairo
92 ppkgs.pygame
93 ppkgs.pillow
94 ppkgs.numpy
95 ]))
96 pkgs.black
97 ];
98 };
99 };
100 shells.ts = {
101 systems = [ "x86_64-linux" ];
102
103 shell =
104 {
105 pkgs,
106 mkShell,
107 }:
108 mkShell {
109 packages = [
110 pkgs.bun
111 pkgs.eslint_d
112 pkgs.eslint
113 pkgs.typescript
114 pkgs.typescript-language-server
115 pkgs.package-version-server
116 pkgs.nixd
117 pkgs.nil
118 ];
119 };
120 };
121 shells.blog = {
122 systems = [ "x86_64-linux" ];
123
124 shell =
125 {
126 pkgs,
127 mkShell,
128 }:
129 mkShell {
130 packages = [
131 pkgs.bun
132 pkgs.nodejs_24
133 pkgs.eslint_d
134 pkgs.eslint
135 pkgs.typescript
136 pkgs.typescript-language-server
137 pkgs.package-version-server
138 pkgs.nixd
139 pkgs.nil
140 pkgs.devenv
141 ];
142 };
143 };
144 shells.html = {
145 systems = [ "x86_64-linux" ];
146
147 shell =
148 {
149 mkShell,
150 pkgs
151 }:
152 mkShell {
153 shellHook = ''
154 serve() {
155 live-server /home/coded/Programming/CMU/html --port 5000
156 }
157 export -f serve
158 '';
159 packages = [
160 pkgs.emmet-language-server
161 pkgs.nixd
162 pkgs.nil
163 pkgs.nodePackages.live-server
164 ];
165 };
166 };
167 shells.backend = {
168 systems = ["x86_64-linux"];
169 shell = {mkShell, lib, system}:
170 let
171 pkgs = import pins.nixpkgs {
172 inherit system;
173 config.allowUnfree = true;
174 };
175 in mkShell {
176 packages = [
177 pkgs.jetbrains.datagrip
178 pkgs.devenv
179 pkgs.mongosh
180 pkgs.mongodb-compass
181 ];
182 };
183 };
184 shells.cicd = {
185 systems = ["x86_64-linux"];
186 shell =
187 {
188 mkShell,
189 pkgs
190 }:
191 mkShell {
192 packages = [
193 pkgs.typst
194 pkgs.tinymist
195 ];
196 };
197 };
198 };
199 }
200)