This commit is contained in:
2026-03-02 16:35:14 +01:00
parent d182532b34
commit a511c65d84
17 changed files with 741 additions and 52 deletions

42
dist/nix-cheatsheet.md vendored Normal file
View File

@@ -0,0 +1,42 @@
# Nix package manager cheatsheet
## Search for packages
```sh
nix search nixpkgs python
```
## Add packages to current shell
```sh
# single package
nix shell nixpkgs#python3
# multiple packages
nix shell nixpkgs#python3 nixpkgs#nodejs
```
## Run a command directly
```sh
nix run nixpkgs#python3 -- --version
```
## Install packages persistently (available in new SSH sessions)
```sh
# nix shell packages are lost when the session ends
# use profile install to persist across sessions
# packages use the nixpkgs# prefix
nix profile install nixpkgs#nodejs nixpkgs#pnpm nixpkgs#yarn
```
## Language stacks
| Stack | Packages |
|-------|----------|
| Node.js | `nodejs`, `pnpm`, `yarn` |
| Python | `python3`, `python3Packages.pip`, `python3Packages.virtualenv`, `uv` |
| Go | `go` |
| Rust | `cargo`, `rustc`, `rustfmt`, `clippy` |
| Foundry | `foundry` |