Skip to content

Instantly share code, notes, and snippets.

@tlehman
Created May 9, 2025 19:36
Show Gist options
  • Save tlehman/65cef110daa2d6bcffe4f8c74407661b to your computer and use it in GitHub Desktop.
Save tlehman/65cef110daa2d6bcffe4f8c74407661b to your computer and use it in GitHub Desktop.
Nix shell file to `pip install grip` so you don't have to pollute your global filesystem with python stuff
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = [
(pkgs.python3.withPackages (ps: [ ps.pip ]))
];
shellHook = ''
export VENV_DIR=$(mktemp -d)
python -m venv $VENV_DIR
source $VENV_DIR/bin/activate
pip install grip
echo "Virtual environment is ready and grip is installed."
'';
}
@tlehman
Copy link
Author

tlehman commented May 9, 2025

Put this into a file called shell.nix directory with markdown files and run nix-shell, then you will have this package. When you exit, all python stuff will be gone, like it was just a bad dream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment