Skip to content

Shell developer environment for Nix

Notifications You must be signed in to change notification settings

vitormiura/env.nix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Env.nix

Have Nix, Have the power of all environments.

AboutKey FeaturesGetting StartedFAQRoadmap

About

Collection of Nix Shells for Developing purposes.

By using the Nix package manager you can have any environment for development in your machine, all this happens due to Nix's reproducible builds and Nix's package manager with 80000 packages avaiable.

Key Features

  • Get started with a simple dev environment for your application.
  • Have access to any necessary package in Nix Packages
  • Or build your own package using the native Nix functions.

Getting Started

Prerequisites

First things first, it's necessary to have Nix installed in your machine, it currently supports most linux distributions, MacOS and Windows through WSL2. You can see here the instructions details for installing on each operating system.

After installing Nix on your machine, enable the flake and nix command experimental feature.

And optionally, you can enable direnv and nix-direnv in your Nix configuration, this makes it possible to use the dev shell environments on your favorite shell other than bash (fish, zsh etc...).

Installing and Running

With direnv and nix-direnv

If you have direnv and nix-direnv installed, you can just create a file called .envrc in the root folder of your project, and them paste this in:

# .envrc
use flake "github:abehidek/env.nix#nodejs"

And voilà!, you have and nodejs environment ready for you to work on in your favorite shell!

You can select other environments, for example you can have elixir:

# .envrc
use flake "github:abehidek/env.nix#elixir"

No direnv and nix-direnv

If you don't want to enable direnv and nix-direnv, you can easily enter in our shell by running:

# Be sure to enable flake and nix-command features on your configuration!!
# nix develop github:abehidek/env.nix#<desired-environment>

$ nix develop github:abehidek/env.nix#nodejs
$ nix develop github:abehidek/env.nix#elixir

You will be dropped into a bash shell with the desired environment dependencies!

Customize your shell

To add or remove dependencies, you can download this repository and edit the shell.nix file or create one and add it into the flake.nix outputs, and then to run instead of pointing into this github repository, you point into your local machine flake.nix.

$ cd ~
$ git clone https://github.com/abehidek/env.nix
$ cd <your-project-directory>
With direnv and nix-direnv

Add the .envrc file into your project root directory.

#.envrc
# use flake <flake-path>#<environment>
use flake ~/env.nix/flake.nix#nodejs
No direnv and nix-direnv
# nix develop <flake-folder-path>#<environment>
$ nix develop ~/env.nix#nodejs

FAQ

Is it any good?

yes.

Roadmap

  • Elixir dev env.
  • Nodejs dev env.
    • Prisma
  • Go dev env.
  • Rust dev env.
    • Tauri

Emailware

Env.nix is an emailware. Meaning, if you liked using this app or it has helped you in any way, I'd like you send me an email at [email protected] about anything you'd want to say about this software. I'd really appreciate it!

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

abehidek.me  ·  GitHub @abehidek  ·  Twitter @guilhermehabe

About

Shell developer environment for Nix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 100.0%