All Projects → numtide → Devshell

numtide / Devshell

Per project developer environments

Labels

Projects that are alternatives of or similar to Devshell

Nix Haskell Monorepo
Pragmatic tutorial on how to use nix with a haskell monorepo
Stars: ✭ 111 (-13.95%)
Mutual labels:  nix
Iohk Ops
NixOps deployment configuration for IOHK devops
Stars: ✭ 113 (-12.4%)
Mutual labels:  nix
Wasm Cross
Nix expressions for cross compiling to WebAssembly
Stars: ✭ 122 (-5.43%)
Mutual labels:  nix
Nixos Config
My NixOS configuration files. (This public mirror is not updated anymore.)
Stars: ✭ 110 (-14.73%)
Mutual labels:  nix
Flake Utils
Pure Nix flake utility functions
Stars: ✭ 113 (-12.4%)
Mutual labels:  nix
Docker
Dockerfiles to package Nix in a minimal docker container
Stars: ✭ 114 (-11.63%)
Mutual labels:  nix
Powerline Rs
GitLab: https://gitlab.com/jD91mZM2/powerline-rs
Stars: ✭ 108 (-16.28%)
Mutual labels:  nix
Micro Ci
A tiny CI server built around GitHub and Nix
Stars: ✭ 126 (-2.33%)
Mutual labels:  nix
Datafiles
A file-based ORM for Python dataclasses.
Stars: ✭ 113 (-12.4%)
Mutual labels:  toml
Nixgl
A wrapper tool for nix OpenGL application
Stars: ✭ 120 (-6.98%)
Mutual labels:  nix
Nixwrt
Build images for embedded MIPS SoCs using NixPkgs (experimental)
Stars: ✭ 111 (-13.95%)
Mutual labels:  nix
Nix Config
My NixOS configuration
Stars: ✭ 112 (-13.18%)
Mutual labels:  nix
Mbp Nixos
Instructions and scripts related to getting NixOS running on a newer generation MBP
Stars: ✭ 115 (-10.85%)
Mutual labels:  nix
Yarn2nix
Generate nix expressions from a yarn.lock file [maintainer=???]
Stars: ✭ 110 (-14.73%)
Mutual labels:  nix
Crate2nix
nix build file generator for rust crates
Stars: ✭ 123 (-4.65%)
Mutual labels:  nix
Staert
Merge your configuration sources
Stars: ✭ 108 (-16.28%)
Mutual labels:  toml
Nix Emacs Ci
Emacs installations for continuous integration
Stars: ✭ 114 (-11.63%)
Mutual labels:  nix
Dotfiles
Configuration files for XMonad, Emacs, NixOS, Taffybar and more.
Stars: ✭ 127 (-1.55%)
Mutual labels:  nix
Dotfiles
My small loan of configuration files and scripts - based on NixOS
Stars: ✭ 124 (-3.88%)
Mutual labels:  nix
Hie Nix
Nix packages for Haskell IDE Engine
Stars: ✭ 118 (-8.53%)
Mutual labels:  nix

devshell - like virtualenv, but for all the languages.

STATUS: unstable

Devshell Dev Environment Support room on Matrix

The goal of this project is to simplify per-project developer environments.

Imagine, a new employee joins the company, or somebody transfers teams, or somebody wants to contribute to one of your Open Source projects. It should take them 10 minutes to clone the repo and get all of the development dependencies.

Documentation

See docs

Features

Compatible

Keep it compatible with:

  • nix-shell
  • direnv
  • nix flakes

Clean environment

pkgs.stdenv.mkDerivation and pkgs.mkShell build on top of the pkgs.stdenv which introduces all sort of dependencies. Each added package, like the pkgs.go in the "Story time!" section has the potential of adding new environment variables, which then need to be unset. The stdenv itself contains either GCC or Clang which makes it hard to select a specific C compiler.

This is why mkDevShell builds its environment from a builtins.derivation.

direnv loads will change from:

direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_INDENT_MAKE +NIX_LDFLAGS +NIX_STORE +NM +OBJCOPY +OBJDUMP +RANLIB +READELF +RUSTC +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +TEMP +TEMPDIR +TMP +TMPDIR +buildInputs +buildPhase +builder +builtDependencies +cargo_bins_jq_filter +cargo_build_options +cargo_options +cargo_release +cargo_test_options +cargoconfig +checkPhase +configureFlags +configurePhase +cratePaths +crate_sources +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +docPhase +dontAddDisableDepTrack +dontUseCmakeConfigure +installPhase +name +nativeBuildInputs +out +outputs +patches +preInstallPhases +propagatedBuildInputs +propagatedNativeBuildInputs +remapPathPrefix +shell +src +stdenv +strictDeps +system +version ~PATH

to:

direnv: export +DEVSHELL_DIR +DEVSHELL_ROOT +IN_NIX_SHELL +NIXPKGS_PATH ~PATH

There are new environment variables useful to support the day-to-day activities:

  • DEVSHELL_DIR: contains all the programs.
  • DEVSHELL_ROOT: points to the project root.
  • NIXPKGS_PATH: path to nixpkgs source.

Common utilities

The shell comes pre-loaded with some utility functions. I'm not 100% sure if those are useful yet:

  • devshell-menu - list all the programs available
  • devshell-root - cd back to the project root.

MOTD

When entering a random project, it's useful to get a quick view of what commands are available.

When running nix-shell or nix develop, mkDevShell prints a welcome message:

### 🔨 Welcome to mkDevShell ####

# Commands

devshell-menu - print this menu
devshell-root - change directory to root
hello         - prints hello
nixpkgs-fmt   - used to format Nix code

Configurable with a TOML file

You might be passionate about Nix, but people on the team might be afraid of that non-mainstream technology. So let them write TOML instead. It should handle 80% of the use-cases and falling back on Nix is always possible.

Bash completion by default

Life is not complete otherwise. Huhu.

Packages that contain bash completions will automatically be loaded by mkDevShell in nix-shell or nix develop modes.

Capture development dependencies in CI

With a CI + Binary cache setup, one often wants to be able to capture all the build inputs of a shell.nix. Before, pkgs.mkShell would even refuse to build! (my fault really). With pkgs.mkDevShell, capturing all of the development dependencies is as easy as:

nix-build shell.nix | cachix push <mycache>

TODO

A lot of things!

Documentation

Explain how all of this works and all the use-cases.

Testing

Write integration tests for all of the use-cases.

Lazy dependencies

This requires some coordination with the repository structure. To keep the dev closure small, it would be nice to be able to load some of the dependencies on demand.

Doctor / nix version check

Not everything can be nicely sandboxed. Is it possible to get a fast doctor script that checks that everything is in good shape?

Support other shells

What? Not everyone is using bash? Right now, support is already available in direnv mode.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].