Opinionated 🤓, batteries-included 🔋, extra-DRY 🤌 Nix ❄️ boilerplate.
nullkommanix [ɪn ˈnʊl ˌkɔma ˈnɪçt͡s] noun German colloquialism (translation: in next to time).
Note
This is the software you need to have on your system. All project-specific software is handled automatically.
- Install Nix (the package manager). The Determinate Nix Installer is recommended.
- Install direnv.
- (optional) Install nix-direnv for better performance during development.
- (if not already done) Clone the repo
- (one-time only) Inside the repo, run
direnv allow
Tip
Windows is not supported by Nix, but you can use the Windows Subsystem for Linux (WSL).
From now on, whenever you change into the directory of your project, all the necessary dependencies etc. will be ready. The first time you enter the directory, this might take some time.
All build-targets are self-documented:
make help
There are two separate aspects to updating the nix dependencies.
- There may be newer versions available given the pinning in
flake.nix
. This can be accomplished by runningmake update-flake
locally and may change theflake.lock
. However such updates may break a project. It is therefore recommended to only run this in CI, using the periodically schedulednix_maintenance.yml
job. It will automatically open pull requests if there are updates available. Users can then inspect whether the updated project still passes all tests. - The versions pinned in
flake.nix
(and the resultingflake.lock
) itself may be out of date. The DeterminateSystems/flake-checker will fail if this is the case. It runs on every push as well as periodically. You can also run this locally usingmake check-flake-checker
.
To bring the shell you are working in up to date with the source
(nix.flake
, etc.)
of your repository:
direnv reload
Or if you have nix-direnv
installed,:
nix-direnv-reload
nix-
/direnv
can be a bit chatty on launch.
Set hide_env_diff=true
to quiet it down.