/nix-flake-template

Template to initialize a flake to create a Nix development shell

Primary LanguageNix

Nix Flake Template

Template to initalize a flake with only the cowsay and hello packages. This improves upon the one generated by nix flake init by being compatible with all available architectures.

Usage

  1. In the directory of your project, run:
nix flake init --template github:jordan-bravo/nix-flake-template
  1. Edit flake.nix and replace cowsay and hello with your desired packages. Separate multiple package names with spaces or new lines.

A good way to search for packages is https://search.nixos.org

The shellHook section is for any shell commands or variables to be set when the development shell starts.

  1. Run the command:
nix develop

and it will run a shell with the specified packages available and shell variables populated.

Run exit to leave the development shell.