{"id":25968768,"url":"https://github.com/vic/use_devshell_toml","last_synced_at":"2026-05-28T01:31:55.775Z","repository":{"id":279211442,"uuid":"937933051","full_name":"vic/use_devshell_toml","owner":"vic","description":"A direnv function to load numtide/devshell TOML files without you writing a line of nix.","archived":false,"fork":false,"pushed_at":"2025-07-15T04:30:31.000Z","size":95,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-15T10:14:19.503Z","etag":null,"topics":["development-environment","devshell","direnv","nix","nix-flake","nix-flake-template"],"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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"oeiuwq","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-02-24T06:34:34.000Z","updated_at":"2025-07-15T04:30:35.000Z","dependencies_parsed_at":"2025-07-15T06:14:21.711Z","dependency_job_id":"8d90a505-108d-4b46-a512-944ecaca4e2f","html_url":"https://github.com/vic/use_devshell_toml","commit_stats":null,"previous_names":["vic/use_devshell_toml"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vic/use_devshell_toml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fuse_devshell_toml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fuse_devshell_toml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fuse_devshell_toml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fuse_devshell_toml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vic","download_url":"https://codeload.github.com/vic/use_devshell_toml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fuse_devshell_toml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33590884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["development-environment","devshell","direnv","nix","nix-flake","nix-flake-template"],"created_at":"2025-03-04T22:25:10.845Z","updated_at":"2026-05-28T01:31:55.768Z","avatar_url":"https://github.com/vic.png","language":"Nix","funding_links":["https://ko-fi.com/oeiuwq"],"categories":[],"sub_categories":[],"readme":"# `use devshell_toml` \n\nThis repository provides a [direnv] function that allows \nyou to load [devshell] TOML environments\nwithout you writting a single line of Nix code. (see [motivation](#motivation))\n\n![demo](https://github.com/user-attachments/assets/d573e297-9f81-49c4-984d-51431fe96118)\n\n\n# Quick Usage\n\nJust run this flake giving it as many [packages](https://search.nixos.org/packages) you need.\n\n```\nnix run github:vic/use_devshell_toml [package ...]\n```\n\nIt will make sure the `use_devshell_toml.sh` function is installed into your direnv lib, and \nwill update `devshell.toml` and `.envrc` in current directory.\n\nThe gif demo above shows this by adding `hello`, `cargo` and `pip` commands in a single command.\n\nBe sure to checkout [devshell] documentation for more info on how to customize your environment. \n\n\u003e That's it. Just a TOML file, no need for you to write a single line of Nix code.\n\n# Home-Manager Setup\n\nIf you are using `home-manager` you can simply include the default homeModule provided by this\nflake and it will install the `use_devshell_toml.sh` helper for you.\n\n```nix\nimports = [ inputs.use_devshell_toml.homeModules.default ];\n```\n\nAlso, a default package providing the `use_devshell_toml` shell command -the same\nutility as shown in the demo.gif above- is exposed at:\n\n```\ninputs.use_devshell_toml.packages.\u003csystem\u003e.default\n```\n\n# Imperative Setup\n\n#### Install/Update the direnv function.\n\nThe following line will install a function in your direnv stdlib directory (`$HOME/.config/direnv/lib/use_devshell_toml.sh`).\n\n```bash\n# You might change ref to any branch or release version.\nnix run \"github:vic/use_devshell_toml?ref=main#install\"\n```\n\nAfter installation, any `.envrc` file of yours can run `use devshell_toml`.\n\n#### Setup your working project\n\nCreate a simple `devshell.toml` and `.envrc` on your current directory.\n\n```toml\n# devshell.toml\n[[commands]]\npackage = \"hello\"  # see https://numtide.github.io/devshell/\n```\n\n```bash\n# .envrc\nuse devshell_toml\n```\n\nAlternatively you can use the following template to create both of them:\n\n```bash\nnix flake init -t github:vic/use_devshell_toml\n```\n\n# Advanced Usage\n\nYou can get pretty far without having to write a single nix line. All this features document\nhow to add more power to your environment by just adding a `flake.toml` file.\n\nBoth `devshell.toml` and `flake.toml` will be watched by `direnv` and your environment will be reloaded\nupon any changes on them. You can always `devshell reload` manually if needed.\n\n##### Adding third-party flake inputs\n\nThis example `flake.toml` shows how to override the `nixpkgs` and `devshell` inputs.\nIn the same way you can add any other flake input (or non-flake) you might need.\n\n```toml\n# flake.toml -- schema is same as flake.nix inputs\n\n[inputs.nixpkgs]\nurl = \"github:NixOS/nixpkgs?ref=nixpkgs-unstable\" # a custom nixpkgs branch\n\n[inputs.devshell]\nurl = \"github:numtide/devshell\"\ninputs.nixpkgs.follows = \"nixpkgs\" # make it depend on the previous nixpkgs branch\n\n[inputs.something]\nurl = \"path:./something\" # use path:./ for relative dependencies\nflake = false # something that is not a flake itself\n```\n\n##### Enabling third-party Overlays\n\nIf you find a flake that provides custom packages via an overlay, you can add include\nthem in your project allowing you to use those tools.\n\n```toml\n# flake.toml\n\n[inputs.something]\nurl = \"github:someorg/something\"\n[inputs.anotherthing]\nurl = \"github:someorg/anotherting\"\n\n[[overlays]]\nsomething = \"default\" # includes overlays.default from the something input\n\n[[overlays]]\nanotherthing = \"foo\"  # includes overlays.foo from the anotherthing input\n\n[[overlays]]\nanotherthing = \"bar\"  # also includes overlays.bar from the anotherthing input\n```\n\n```toml\n# devshell.toml\n[[commands]]\npackage = \"foo\" # uses the foo package provided by the anotherthing overlay.\n```\n\n\n##### Custom nix config\n\nSometimes it might be helpful to set some nix config while loading your environment.\nFor example allowing unfree packages or adding nix caches.\n\n```toml\n# flake.toml\n\n[nix-config]\nallowUnfree = true\nextra-substituters = \"https://some-nix-cache.org\"\nextra-trusted-public-keys = \"some-nix-cache.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=\" \n```\n\n##### Importing devshell nix-modules.\n\n[devshell] TOML files allow you to import other TOML-modules or Nix-syntax modules. The later\nones are ofcourse more powerful, if you are willing to write simple nix expressions. As they\nallow you to customize packages themselves or access your flake inputs directly.\n\n```toml\n# devshell.toml -- See https://numtide.github.io/devshell/extending.html\nimports = [ \"./mill.nix\" ] # Imports should always be the first line in the TOML file.\n```\n\n```nix\n# mill.nix -- See https://numtide.github.io/devshell/modules_schema.html\n{inputs, pkgs, ...}: let\n  jre = pkgs.graalvm-ce;\n  mill = pkgs.mill.override { inherit jre; } # use a custom JVM\nin {\n  commands = [ { package = mill; } ];  # provide the mill command to the environment\n}\n```\n\n##### The Eject button\n\nIf you need more power, maybe your project is ready to contain a `flake.nix` itself.\nDon't worry we all knew the time would come.\nThe easiest way is to use [devshell's toml template](https://github.com/numtide/devshell/tree/main/templates/toml).\n\n```bash\nnix flake init -t github:numtide/devshell#toml\n```\n\n# Motivation\n\nMany times I'm checking-out other people's repositories and just need a quick way to setup the required environment to work on them.\nHowever, they might not have any `flake.nix` nor `shell.nix` files on them, and maybe I'm not even trying to add them myself to their\nrepository, but just want a quick way to have those tools available for me.\n\nSince I'm already using `direnv` system wide, I just wanted to edit a simple `devshell.toml` file and get my env loaded without \nthinking about adding any nix files to the repo.\n\nMany modern nix environment-tools are trying to use popular configuration languages (`json`, `toml`) in order to attract people who are not\nas familiar with the nix-language. Allowing them to take advantage of the all nix packages from the comfort of simpler languages.\n\nSince [devshell] already has excellent support for loading TOML files, this project only tries to make it as quick as it can get for\npeople already using [direnv]. Without them having to write any nix plumbing code, just edit `devshell.toml` on the current directory.\n\n\n#### Upsides\n\n- Quick, edit-toml-and-forget environments.\n- All the advanced features provided by devshell and nixpkgs.\n- Extensible, first via toml and later growing into proper nix code.\n\n#### Downsides\n\n- Flake is generated in hidden `.direnv/devshell-flake` directory whenever the user enters the project root.\n- Since flake is generated in a git ignored dir, sometimes you might need to `rm -rf .direnv \u0026\u0026 direnv allow` to fully reload.\n\n\n[direnv]: https://direnv.net\n[devshell]: https://numtide.github.io/devshell\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvic%2Fuse_devshell_toml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvic%2Fuse_devshell_toml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvic%2Fuse_devshell_toml/lists"}