A template repository implementing Palisade's coding guide. Features:
- Nix + uv + direnv environment for development and CI
- Figures and the paper build in CI
- Lint and format pre-commit hooks
- VSCode settings and extensions
To set up your system for the first time, run:
# Setup Nix
sh <(curl -L https://nixos.org/nix/install) --daemon
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
exit # the commands below need a fresh shell
# Install direnv
nix profile install nixpkgs#direnv nixpkgs#nix-direnv
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' >> ~/.config/direnv/direnvrc
# Install pre-commit
nix profile install nixpkgs#pre-commit
After cloning the repository, run:
# allow loading environment from flake.nix, pyproject.toml, and .env
direnv allow
# install linting and formatting hooks
pre-commit install && pre-commit run
Use Cursor to edit code. It will suggest extensions to install when you open the project.
cd template # automatically loads environment
ninja # builds figures and the paper
git commit # checks format and lints
flake.nix
defines system dependencies liketexlive
pyproject.toml
defines Python dependencies likematplotlib
build.ninja
defines build targets likepaper
andfigures