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 }; 59 shells.default = config.shells.python; 60 shells.python = { 61 # Declare what systems the shell can be used on. 62 systems = [ "x86_64-linux" ]; 63 64 # Define our shell environment. 65 shell = 66 { 67 pkgs, 68 mkShell, 69 ... 70 }: 71 mkShell { 72 packages = [ 73 pkgs.python314 74 pkgs.black 75 ]; 76 }; 77 }; 78 shells.cmu-graphics = { 79 systems = [ "x86_64-linux" ]; 80 shell = 81 { 82 pkgs, 83 mkShell, 84 ... 85 }: 86 let 87 python3 = pkgs.python313.override { 88 packageOverrides = pyfinal: pyprev: { 89 cmu_graphics = config.packages.cmu-graphics.result.x86_64-linux; 90 }; 91 }; 92 in 93 mkShell { 94 packages = [ 95 (python3.withPackages (ppkgs: [ 96 ppkgs.cmu_graphics 97 ppkgs.pycairo 98 ppkgs.pygame 99 ppkgs.pillow 100 ppkgs.numpy 101 ])) 102 ]; 103 }; 104 }; 105 }; 106 } 107)