As flake
is still an experimental feature of nix, --experimental-features 'nix-command flakes'
is needed for nix
command.
Add the following to ~/.config/nix/nix.conf
or /etc/nix/nix.conf
could avoid adding the option every time invoking nix
command.
experimental-features = nix-command flakes
direnv
is required to install before used, for installation guide please refer to https://direnv.net/docs/installation.html
Enabling direnv
would greatly enhance the development experience. Once enabled, all dependencies will be installed, and the shell will be augmented according to the specifications in flake.nix whenever you enter the project directory from your shell. The initial setup might take a bit longer when entering the project directory for the first time.
If you're new to direnv
, you must hook it into your shell first (e.x. append eval "$(direnv hook bash)"
in ~/.bashrc
for bash
), for other shells please refer to hook direnv into your shell.
After integrating direnv
with your shell, it can be enabled or disabled using direnv allow
and direnv deny
respectively.
nixpkgs-fmt
forNix
shfmt
and for shell scriptastyle
for .c, .h files
When used together with direnv, the tools should be automatically discoverable by the shell.