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 }: 12 { 13 config = { 14 inputs = { 15 fenix.src = pins.fenix; 16 nixpkgs = { 17 src = pins.nixpkgs; 18 settings.overlays = [ 19 config.inputs.fenix.result.overlays.default 20 ]; 21 }; 22 }; 23 packages.cmu-graphics = { 24 systems = [ "x86_64-linux" ]; 25 package = 26 { 27 pkgs, 28 python313, 29 fetchPypi, 30 }: 31 let 32 pname = "cmu_graphics"; 33 version = "1.1.43"; 34 in 35 python313.pkgs.buildPythonPackage { 36 inherit pname version; 37 38 src = fetchPypi { 39 inherit pname version; 40 hash = "sha256-IU6z+4xB7Uz/SsIrFkFRfLL10ZmpQTPyK+yDWDq89Xs="; 41 }; 42 43 doCheck = false; 44 checkPhase = '' 45 true 46 ''; 47 dontCheckPythonPackages = true; 48 pyproject = true; 49 50 dependencies = [ 51 python313.pkgs.pycairo 52 python313.pkgs.pygame 53 ]; 54 55 build-system = [ 56 python313.pkgs.setuptools 57 python313.pkgs.wheel 58 pkgs.pre-commit 59 ]; 60 61 }; 62 }; 63 shells.default = config.shells.html; 64 shells.python = { 65 # Declare what systems the shell can be used on. 66 systems = [ "x86_64-linux" ]; 67 68 # Define our shell environment. 69 shell = 70 { 71 pkgs, 72 mkShell, 73 ... 74 }: 75 let 76 python3 = pkgs.python313.override { 77 packageOverrides = pyfinal: pyprev: { 78 cmu_graphics = config.packages.cmu-graphics.result.x86_64-linux; 79 }; 80 }; 81 in 82 mkShell { 83 shellHook = '' 84 [ "$(hostname)" = "shorthair" ] && export ZED_PREDICT_EDITS_URL=http://localhost:9000/predict_edits 85 unset TMPDIR 86 ''; 87 packages = [ 88 (python3.withPackages (ppkgs: [ 89 ppkgs.pandas 90 ppkgs.pandas-stubs 91 ppkgs.matplotlib 92 ppkgs.seaborn 93 ppkgs.numpy 94 ppkgs.requests 95 ppkgs.geopy 96 ppkgs.cmu_graphics 97 ppkgs.pycairo 98 ppkgs.pygame 99 ppkgs.pillow 100 ppkgs.numpy 101 ])) 102 pkgs.black 103 ]; 104 }; 105 }; 106 shells.ts = { 107 systems = [ "x86_64-linux" ]; 108 109 shell = 110 { 111 pkgs, 112 mkShell, 113 }: 114 mkShell { 115 shellHook = '' 116 unset TMPDIR 117 ''; 118 packages = [ 119 pkgs.bun 120 pkgs.eslint_d 121 pkgs.eslint 122 pkgs.typescript 123 pkgs.typescript-language-server 124 pkgs.package-version-server 125 pkgs.nixd 126 pkgs.nil 127 ]; 128 }; 129 }; 130 shells.html = { 131 systems = [ "x86_64-linux" ]; 132 133 shell = 134 { 135 pkgs, 136 mkShell, 137 }: 138 mkShell { 139 shellHook = '' 140 unset TMPDIR 141 serve() { 142 live-server /home/coded/Programming/CMU/html --port 5000 143 } 144 export -f serve 145 ''; 146 packages = [ 147 pkgs.emmet-language-server 148 pkgs.nixd 149 pkgs.nil 150 pkgs.nodePackages.live-server 151 ]; 152 }; 153 }; 154 shells.rust = { 155 systems = [ "x86_64-linux" "aarch64-linux" ]; 156 157 shell = { mkShell, fenix, bacon, pkg-config, ... }: 158 mkShell { 159 packages = [ 160 (fenix.complete.withComponents [ 161 "cargo" 162 "clippy" 163 "rust-src" 164 "rustc" 165 "rustfmt" 166 "rust-analyzer" 167 ]) 168 bacon 169 pkg-config 170 ]; 171 }; 172 }; 173 }; 174 } 175)