Skip to content

snyssen/nix-dev-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snyssen's Nix Development Environment template

This repository is a template for starting new projects with dev environment and dependencies handled by Nix, automatically loaded with direnv, and using Just for easy initial setup and commands handling, as well as Pre-commit for running checks on each commit.

Pre-Requisites

This template tries to make as few assumptions about your system as possible by making sure that most dependencies are defined in the Nix flake itself. However, it still cannot avoid these two assumptions:

  1. Your system can run Nix flakes.
  2. Your system has direnv installed (because it is used to automatically load the flake, so it has to already be available).

For Nix flakes support, I recommend using The Determinate Nix Installer to install the Nix package manager on your machine. Or, for a more drastic and permanent solution, why not have your whole system be a Nix flake by using NixOS as your operating system?

For direnv, see their Getting Started for installation instructions.

Additional Recommendations

If you are using Visual Studio Code, I recommend installing the direnv extension as well. This way, any other extension you have installed will benefit from the dependencies added by the Nix flake.

First Start

You have two options to start using this template:

  1. If creating a new repository on Github, you can directly use this template as its starting point.
  2. Otherwise, simply copy and paste the files from this repository at the root of your project.

Once the files are in place, you should:

  1. Run direnv allow to allow direnv to load the .envrc file. This should in turn automatically build the Nix flake and load the dependencies.
  2. Run just setup to run the setup command (this will simply install the pre-commit hook).

You are now ready to start hacking!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published