Skip to content

Instantly share code, notes, and snippets.

@ibizaman
Created July 1, 2026 18:54
Show Gist options
  • Select an option

  • Save ibizaman/9688bc6a4c402ffd3b40043ac601bd9a to your computer and use it in GitHub Desktop.

Select an option

Save ibizaman/9688bc6a4c402ffd3b40043ac601bd9a to your computer and use it in GitHub Desktop.
A shell.nix to develop for pygame
{
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
(pkgs.callPackage ./sync.nix { })
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