Opinionated repository template
wget https://github.com/sambacha/nix-template/archive/master.zip
Based on nix.dev tutorials, repository template to get you started with Nix:
- niv for painless dependency management (aka pinning) with a daily cronjob to bump dependencies
- gitignore.nix for respecting
.gitignore
when using your project as a source - pre-commit-hooks.nix for running linters (defaults to
shellcheck
,nix-linter
andnixpkgs-fmt
) when committing and on the CI - direnv for automatically loading your developer environment
- GitHub Actions for CI with dependabot automatically bumping GitHub Actions versions
- Follow tutorial for creating a binary cache
- Replace
nix-getting-started-template
in.github/workflows/test.yml
with the name of your binary cache
Follow direnv setup and run direnv allow
# Cachix Workflow
name: "cachix"
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: cachix/install-nix-action@v12
- uses: cachix/cachix-action@v8
with:
name: nix-getting-started-template
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
# Only needed for private caches
#authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-build https://github.com/$GITHUB_REPOSITORY/archive/$GITHUB_SHA.tar.gz
- run: nix-shell https://github.com/$GITHUB_REPOSITORY/archive/$GITHUB_SHA.tar.gz --run "echo OK"