Created
March 13, 2026 21:06
-
-
Save ibizaman/c26c45e00b2593997b136b65c4da68c3 to your computer and use it in GitHub Desktop.
shell.nix for pygame with pycharm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| nixpkgs ? fetchTarball { | |
| url = "https://github.com/NixOS/nixpkgs/archive/0590cd39f728e129122770c029970378a79d076a.tar.gz"; | |
| sha256 = "1ia5kjykm9xmrpwbzhbaf4cpwi3yaxr7shl6amj8dajvgbyh2yh4"; | |
| }, | |
| pkgs ? import nixpkgs { | |
| config = { allowUnfree = true; }; | |
| }, | |
| }: | |
| let | |
| pythonWithPkgs = pkgs.python3.withPackages (python-pkgs: with python-pkgs; [ | |
| pygame-gui | |
| ]); | |
| in | |
| pkgs.mkShellNoCC { | |
| packages = with pkgs; [ | |
| uv | |
| jetbrains.pycharm | |
| pythonWithPkgs | |
| ]; | |
| shellHook = '' | |
| export VENV_DIR="$PWD/.venv" | |
| if [ ! -d "$VENV_DIR" ]; then | |
| ${pythonWithPkgs}/bin/python -m venv $VENV_DIR | |
| fi | |
| source $VENV_DIR/bin/activate | |
| export PYTHONPATH="${pythonWithPkgs}/lib/python3.13/site-packages:$PYTHONPATH" | |
| ''; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment