{"id":13682154,"url":"https://github.com/numtide/devshell","last_synced_at":"2025-05-14T14:06:54.019Z","repository":{"id":37095804,"uuid":"285092401","full_name":"numtide/devshell","owner":"numtide","description":"Per project developer environments","archived":false,"fork":false,"pushed_at":"2025-03-17T10:38:59.000Z","size":1532,"stargazers_count":1361,"open_issues_count":88,"forks_count":91,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-05-08T03:59:32.108Z","etag":null,"topics":["direnv","nix","toml"],"latest_commit_sha":null,"homepage":"https://numtide.github.io/devshell/","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numtide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-08-04T20:29:01.000Z","updated_at":"2025-05-07T15:47:50.000Z","dependencies_parsed_at":"2023-01-29T23:15:16.328Z","dependency_job_id":"fd0da827-8f62-4a47-ab31-ea7783a2c619","html_url":"https://github.com/numtide/devshell","commit_stats":{"total_commits":304,"total_committers":39,"mean_commits":7.794871794871795,"dds":0.5164473684210527,"last_synced_commit":"dd6b80932022cea34a019e2bb32f6fa9e494dfef"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fdevshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fdevshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fdevshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numtide%2Fdevshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numtide","download_url":"https://codeload.github.com/numtide/devshell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159180,"owners_count":22024558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["direnv","nix","toml"],"created_at":"2024-08-02T13:01:41.445Z","updated_at":"2025-05-14T14:06:53.966Z","avatar_url":"https://github.com/numtide.png","language":"Nix","funding_links":[],"categories":["Nix","nix","Development","Flake Modules"],"sub_categories":["Discovery","Community Modules"],"readme":"# devshell - like virtualenv, but for all the languages\n\n\u003ch3\u003eSTATUS: unstable\u003c/h3\u003e\n\n[![Devshell Dev Environment](https://img.shields.io/badge/nix-devshell-blue?logo=NixOS\u0026labelColor=ccc)](https://github.com/numtide/devshell) [![Support room on Matrix](https://img.shields.io/matrix/devshell:numtide.com.svg?label=%23devshell%3Anumtide.com\u0026logo=matrix\u0026server_fqdn=matrix.numtide.com)](https://matrix.to/#/#devshell:numtide.com)\n\nThe goal of this project is to simplify per-project developer environments.\n\nImagine, a new employee joins the company, or somebody transfers teams, or\nsomebody wants to contribute to one of your Open Source projects. It\nshould take them 10 minutes to clone the repo and get all of the development\ndependencies.\n\n## Documentation\n\nSee [docs](https://numtide.github.io/devshell/) ([docs source](docs))\n\n## Features\n\n### Compatible\n\nKeep it compatible with:\n\n* nix-shell\n* direnv\n* nix flakes\n\n### Clean environment\n\n`pkgs.stdenv.mkDerivation` and `pkgs.mkShell` build on top of the\n`pkgs.stdenv` which introduces all sort of dependencies. Each added package,\nlike the `pkgs.go` in the \"Story time!\" section has the potential of adding\nnew environment variables, which then need to be unset. The `stdenv` itself\ncontains either GCC or Clang which makes it hard to select a specific C\ncompiler.\n\nThis is why `mkShell` builds its environment from a `builtins.derivation`.\n\ndirenv loads will change from:\n\n```sh\ndirenv: 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\n```\n\nto:\n\n```sh\ndirenv: export +DEVSHELL_DIR +PRJ_DATA_DIR +PRJ_ROOT +IN_NIX_SHELL +NIXPKGS_PATH ~PATH\n```\n\nThere are new environment variables useful to support the day-to-day\nactivities:\n\n* `DEVSHELL_DIR`: contains all the programs.\n* `PRJ_ROOT`: points to the project root.\n* `PRJ_DATA_DIR`: points to `$PRJ_ROOT/.data` by default. Is used to store runtime data.\n* `NIXPKGS_PATH`: path to `nixpkgs` source.\n\n### Common utilities\n\nThe shell comes pre-loaded with some utility functions. I'm not 100% sure if\nthose are useful yet:\n\n* `menu` - list all the programs available\n\n### MOTD\n\nWhen entering a random project, it's useful to get a quick view of what\ncommands are available.\n\nWhen running `nix-shell` or `nix develop`, `mkShell` prints a welcome message:\n\n```sh\n🔨 Welcome to devshell\n\n[[general commands]]\n\n  hello         - prints hello\n  menu          - prints this menu\n\n[formatters]\n\n  nixpkgs-fmt   - Nix code formatter for nixpkgs\n\n[linters]\n\n  golangci-lint - golang linter\n\n[utilites]\n\n  hub           - github utility\n\n[devshell]$ \n```\n\n### Configurable with a TOML file\n\nYou might be passionate about Nix, but people on the team might be afraid of\nthat non-mainstream technology. So let them write TOML instead. It should\nhandle 80% of the use-cases and falling back on Nix is always possible.\n\n### Bash completion by default\n\nLife is not complete otherwise. Huhu.\n\nPackages that contain bash completions will automatically be loaded by\n`mkShell` in `nix-shell` or `nix develop` modes.\n\n### Capture development dependencies in CI\n\nWith a CI + Binary cache setup, one often wants to be able to capture all the\nbuild inputs of a `shell.nix`. With `mkShell` capturing all of the\ndevelopment dependencies is as easy as:\n\n```sh\nnix-build shell.nix | cachix push \u003cmycache\u003e\n```\n\n### Runnable as a Nix application\n\nDevshells are runnable (via `nix run`).  This makes it possible to run commands defined in your devshell without entering a `nix-shell` or `nix develop` session:\n\n```sh\nnix run '.#\u003cmyapp\u003e' -- \u003cdevshell-command\u003e \u003cand-args\u003e\n```\n\nThis project itself exposes a Nix application; you can try it out with:\n\n```sh\nnix run 'github:numtide/devshell' -- hello\n```\n\nSee [here](docs/src/flake-app.md) for more details.\n\n## TODO\n\nA lot of things!\n\n* **Documentation**\n  * Explain how all of this works and all the use-cases.\n* **Testing**\n  * Write integration tests for all of the use-cases.\n* **Lazy dependencies**\n  * This requires some coordination with the repository structure. To keep the\n    dev closure small, it would be nice to be able to load some of the\n    dependencies on demand.\n* **Doctor / nix version check**\n  * Not everything can be nicely sandboxed. Is it possible to get a fast doctor\n    script that checks that everything is in good shape?\n* **Support other shells**\n  * What? Not everyone is using bash? Right now, support is already available in\n    direnv mode.\n\n## Contributing\n\n### Docs\n\n1. Change files in `docs/`\n1. Run `nix run .#docs`\n1. Open [`docs`](http://localhost:3000/index.html)\n\n### Benchmark\n\n1. See [benchmark/README.md](./benchmark/README.md)\n1. Run `nix run .#bench`\n\n## Commercial support\n\nLooking for help or customization?\n\nGet in touch with Numtide to get a quote. We make it easy for companies to\nwork with Open Source projects: \u003chttps://numtide.com/contact\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fdevshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumtide%2Fdevshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumtide%2Fdevshell/lists"}