├── docs ├── blog │ ├── index.md │ └── .authors.yml ├── assets │ ├── logo.webp │ ├── images │ │ ├── cachix.webp │ │ ├── nixcon.webp │ │ └── process-compose.png │ ├── devenv-preview.tar.gz │ ├── extra.css │ └── favicon.svg ├── editor-support │ ├── zed.md │ ├── vscode.md │ └── phpstorm.md ├── index.md ├── individual-docs │ ├── languages │ │ ├── c.md │ │ ├── cue.md │ │ ├── elm.md │ │ ├── go.md │ │ ├── lua.md │ │ ├── nim.md │ │ ├── nix.md │ │ ├── php.md │ │ ├── r.md │ │ ├── v.md │ │ ├── zig.md │ │ ├── ansible.md │ │ ├── clojure.md │ │ ├── crystal.md │ │ ├── dart.md │ │ ├── deno.md │ │ ├── dotnet.md │ │ ├── elixir.md │ │ ├── erlang.md │ │ ├── fortran.md │ │ ├── gawk.md │ │ ├── gleam.md │ │ ├── haskell.md │ │ ├── idris.md │ │ ├── java.md │ │ ├── jsonnet.md │ │ ├── julia.md │ │ ├── kotlin.md │ │ ├── lean4.md │ │ ├── ocaml.md │ │ ├── odin.md │ │ ├── opentofu.md │ │ ├── pascal.md │ │ ├── perl.md │ │ ├── python.md │ │ ├── racket.md │ │ ├── raku.md │ │ ├── ruby.md │ │ ├── rust.md │ │ ├── scala.md │ │ ├── shell.md │ │ ├── solidity.md │ │ ├── swift.md │ │ ├── texlive.md │ │ ├── unison.md │ │ ├── vala.md │ │ ├── cplusplus.md │ │ ├── javascript.md │ │ ├── purescript.md │ │ ├── standardml.md │ │ ├── terraform.md │ │ ├── typescript.md │ │ └── robotframework.md │ ├── services │ │ ├── adminer.md │ │ ├── blackfire.md │ │ ├── caddy.md │ │ ├── cassandra.md │ │ ├── couchdb.md │ │ ├── elasticmq.md │ │ ├── httpbin.md │ │ ├── influxdb.md │ │ ├── mailhog.md │ │ ├── mailpit.md │ │ ├── memcached.md │ │ ├── minio.md │ │ ├── mongodb.md │ │ ├── mysql.md │ │ ├── nginx.md │ │ ├── postgres.md │ │ ├── rabbitmq.md │ │ ├── redis.md │ │ ├── temporal.md │ │ ├── typesense.md │ │ ├── varnish.md │ │ ├── vault.md │ │ ├── wiremock.md │ │ ├── clickhouse.md │ │ ├── cockroachdb.md │ │ ├── dynamodb-local.md │ │ ├── elasticsearch.md │ │ ├── meilisearch.md │ │ ├── opensearch.md │ │ ├── trafficserver.md │ │ └── opentelemetry-collector.md │ └── process-managers │ │ ├── honcho.md │ │ ├── hivemind.md │ │ ├── overmind.md │ │ └── process-compose.md ├── community │ └── get-involved.md ├── overrides │ ├── main.html │ └── partials │ │ └── copyright.html ├── supported-services │ ├── trafficserver.md │ ├── adminer.md │ ├── influxdb.md │ ├── httpbin.md │ ├── elasticmq.md │ └── dynamodb-local.md ├── integrations │ ├── delta.md │ ├── codespaces-devcontainer.md │ ├── difftastic.md │ └── dotenv.md ├── examples.md ├── supported-languages │ ├── elm.md │ ├── raku.md │ ├── gawk.md │ ├── kotlin.md │ ├── shell.md │ ├── clojure.md │ ├── cplusplus.md │ ├── jsonnet.md │ ├── crystal.md │ ├── typescript.md │ ├── r.md │ ├── go.md │ ├── v.md │ ├── cue.md │ ├── lua.md │ ├── nim.md │ ├── nix.md │ ├── zig.md │ ├── dart.md │ ├── deno.md │ ├── gleam.md │ ├── lean4.md │ ├── swift.md │ ├── julia.md │ ├── ansible.md │ ├── dotnet.md │ ├── elixir.md │ ├── erlang.md │ ├── fortran.md │ ├── unison.md │ ├── opentofu.md │ ├── racket.md │ ├── purescript.md │ ├── standardml.md │ ├── ocaml.md │ ├── robotframework.md │ ├── vala.md │ ├── idris.md │ ├── c.md │ ├── perl.md │ ├── pascal.md │ ├── texlive.md │ └── odin.md ├── supported-process-managers │ ├── honcho.md │ ├── hivemind.md │ └── overmind.md ├── garbage-collection.md └── languages.md ├── examples ├── ruby │ ├── .ruby-version │ ├── Gemfile │ ├── devenv.yaml │ ├── .test.sh │ └── devenv.nix ├── .gitignore ├── imports │ ├── devenv.nix │ ├── file.nix │ ├── devenv.yaml │ ├── folder │ │ └── devenv.nix │ └── .test.sh ├── lean4 │ ├── .gitignore │ ├── devenv.nix │ └── .test.sh ├── phoenix │ ├── .gitignore │ ├── .test.sh │ ├── .setup.sh │ ├── README.md │ └── devenv.nix ├── python-django │ ├── myapp │ │ ├── __init__.py │ │ ├── migrations │ │ │ └── __init__.py │ │ ├── tests.py │ │ └── apps.py │ ├── .gitignore │ ├── myproject │ │ ├── __init__.py │ │ ├── asgi.py │ │ ├── wsgi.py │ │ └── urls.py │ ├── devenv.yaml │ ├── pyproject.toml │ ├── manage.py │ └── devenv.nix ├── rubyonrails │ ├── .gitignore │ ├── devenv.yaml │ ├── .setup.sh │ ├── README.md │ ├── .test.sh │ └── devenv.nix ├── android │ ├── devenv.yaml │ ├── devenv.nix │ └── .patch.sh ├── python │ ├── requirements.txt │ ├── .test.sh │ ├── devenv.yaml │ └── devenv.nix ├── vault │ ├── devenv.yaml │ ├── devenv.nix │ └── .test.sh ├── cockroachdb │ ├── devenv.yaml │ └── devenv.nix ├── dynamodb-local │ ├── devenv.yaml │ ├── devenv.nix │ └── .test.sh ├── supported-languages │ ├── devenv.yaml │ ├── .envrc │ └── .patch.sh ├── compose │ ├── devenv.yaml │ ├── projectA │ │ └── devenv.nix │ ├── projectB │ │ ├── devenv.nix │ │ └── devenv.yaml │ └── devenv.nix ├── simple-remote │ ├── .test.sh │ ├── devenv.nix │ └── devenv.yaml ├── jsonnet │ ├── .test.sh │ └── devenv.nix ├── nur │ ├── devenv.yaml │ ├── .envrc │ └── devenv.nix ├── python-venv │ ├── .gitignore │ ├── devenv.nix │ ├── .test.sh │ └── README.md ├── couchdb │ └── devenv.nix ├── mailpit │ ├── devenv.nix │ └── .test.sh ├── python-directory │ ├── .gitignore │ ├── devenv.yaml │ ├── devenv.nix │ ├── .test.sh │ └── directory │ │ └── pyproject.toml ├── python-poetry │ ├── .gitignore │ ├── devenv.yaml │ ├── pyproject.toml │ ├── .test.sh │ └── devenv.nix ├── rust-wasm-cross │ ├── .test.js │ ├── devenv.yaml │ ├── .test.sh │ ├── app │ │ └── Cargo.toml │ └── devenv.nix ├── rust │ ├── app │ │ ├── src │ │ │ └── main.rs │ │ ├── Cargo.lock │ │ └── Cargo.toml │ ├── devenv.yaml │ ├── .test.sh │ └── devenv.nix ├── meilisearch │ └── devenv.nix ├── terraform │ ├── .test.sh │ ├── devenv.yaml │ └── devenv.nix ├── javascript │ ├── .test.sh │ ├── .gitignore │ ├── devenv.nix │ └── package.json ├── minio │ ├── .test.sh │ └── devenv.nix ├── modern-c │ ├── README.md │ └── devenv.nix ├── simple │ ├── devenv.yaml │ ├── .gitignore │ ├── .envrc │ └── devenv.nix ├── javascript-bun │ ├── .test.sh │ ├── .gitignore │ ├── devenv.nix │ └── package.json ├── javascript-pnpm │ ├── .test.sh │ ├── .gitignore │ ├── devenv.nix │ └── package.json ├── javascript-yarn │ ├── .test.sh │ ├── .gitignore │ ├── devenv.nix │ └── package.json ├── mongodb │ ├── devenv.yaml │ └── devenv.nix ├── javascript-directory │ ├── .test.sh │ ├── .gitignore │ ├── devenv.nix │ └── directory │ │ └── package.json ├── clickhouse │ ├── .test.sh │ └── devenv.nix ├── solidity │ ├── .test.sh │ ├── devenv.nix │ └── devenv.yaml ├── rabbitmq │ ├── .test.sh │ └── devenv.nix ├── scala │ └── devenv.nix ├── postgres-timescale │ ├── .test.sh │ └── devenv.nix ├── fly.io │ ├── .test.sh │ ├── hello.py │ ├── devenv.yaml │ ├── fly.toml │ ├── README.md │ └── devenv.nix ├── gleam │ ├── .test.sh │ └── devenv.nix ├── shell │ ├── .test.sh │ └── devenv.nix ├── mysql │ ├── .test.sh │ └── devenv.nix ├── overlays │ ├── subflake │ │ └── flake.nix │ ├── devenv.nix │ └── devenv.yaml ├── postgres │ ├── .test.sh │ └── devenv.nix ├── texlive │ └── devenv.nix ├── httpbin │ ├── .test.sh │ └── devenv.nix ├── hivemind │ └── devenv.nix ├── overmind │ └── devenv.nix ├── scripts │ └── README.md ├── opentelemetry-collector │ └── .test.sh ├── elasticmq │ ├── devenv.nix │ └── .test.sh ├── starship │ ├── starship.toml │ └── devenv.nix ├── perl │ └── devenv.nix ├── temporal │ ├── devenv.nix │ └── .test.sh ├── influxdb │ └── .test.sh ├── trafficserver │ ├── .test.sh │ └── devenv.nix ├── varnish │ ├── .test.sh │ └── devenv.nix ├── wiremock │ └── devenv.nix ├── aws-vault │ └── devenv.nix ├── racket │ └── devenv.nix ├── caddy-php │ └── devenv.nix ├── vala │ └── devenv.nix └── mkcert │ └── devenv.nix ├── src └── modules │ ├── latest-version │ ├── flake.nix │ ├── debug.nix │ ├── languages │ ├── raku.nix │ ├── jsonnet.nix │ ├── typescript.nix │ ├── kotlin.nix │ ├── gawk.nix │ ├── cplusplus.nix │ ├── elm.nix │ ├── clojure.nix │ ├── shell.nix │ ├── crystal.nix │ ├── pascal.nix │ ├── r.nix │ ├── v.nix │ ├── cue.nix │ ├── dart.nix │ ├── lean4.nix │ ├── julia.nix │ ├── nim.nix │ ├── zig.nix │ ├── lua.nix │ ├── racket.nix │ ├── unison.nix │ ├── opentofu.nix │ ├── idris.nix │ ├── gleam.nix │ ├── ansible.nix │ ├── vala.nix │ ├── elixir.nix │ ├── fortran.nix │ ├── erlang.nix │ ├── standardml.nix │ ├── swift.nix │ ├── robotframework.nix │ ├── perl.nix │ ├── dotnet.nix │ ├── deno.nix │ ├── texlive.nix │ ├── ocaml.nix │ ├── nix.nix │ ├── purescript.nix │ └── c.nix │ ├── integrations │ ├── delta.nix │ └── difftastic.nix │ ├── process-managers │ ├── hivemind.nix │ ├── honcho.nix │ └── overmind.nix │ ├── info.nix │ └── services │ ├── trafficserver │ ├── ip_allow.json │ └── update.sh │ ├── influxdb.nix │ ├── elasticmq.nix │ └── httpbin.nix ├── tests ├── cli │ ├── .gitignore │ ├── devenv.nix │ └── .test.sh ├── impure │ ├── devenv.yaml │ └── devenv.nix ├── .gitignore ├── unversioned-devenv-nix │ ├── .gitignore │ ├── .test.sh │ └── .patch.sh ├── postgresql-localhost │ ├── .test.sh │ └── devenv.nix ├── gitignore │ ├── .setup.sh │ ├── devenv.nix │ └── .test.sh ├── glibcLocales │ └── devenv.nix ├── redis-socket │ ├── devenv.nix │ └── .test.sh ├── dotenv │ ├── .test.sh │ ├── devenv.nix │ └── .setup.sh ├── clean │ ├── devenv.yaml │ └── devenv.nix ├── python-native-libs │ ├── .test.sh │ └── devenv.nix ├── python-native-libs-uv │ ├── .test.sh │ └── devenv.nix ├── python-native-libs-poetry │ ├── .test.sh │ ├── devenv.nix │ └── subdir │ │ └── pyproject.toml ├── postgres-pghost │ ├── devenv.nix │ └── .test.sh ├── mysql │ ├── .test.sh │ └── devenv.nix └── up-uses-shell │ └── devenv.nix ├── templates ├── simple │ ├── .gitignore │ └── .envrc ├── terraform │ ├── .gitignore │ └── .envrc └── flake-parts │ ├── .gitignore │ └── .envrc ├── xtask ├── src │ ├── cli.rs │ ├── lib.rs │ ├── manpage.rs │ └── shell_completion.rs └── Cargo.toml ├── .cargo └── config.toml ├── logos ├── .DS_Store ├── devenv-github.png ├── favicons │ ├── .DS_Store │ ├── favicon.ico │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── apple-touch-icon.png │ ├── android-chrome-192x192.png │ └── android-chrome-512x512.png ├── devenv-light-vertical.png └── devenv-light-horizontal.png ├── _redirects ├── postcss.config.js ├── .gitpod.yml ├── devenv ├── init │ ├── .gitignore │ ├── .envrc │ ├── devenv.yaml │ └── devenv.nix ├── src │ └── lib.rs └── Cargo.toml ├── .github ├── ISSUE_TEMPLATE │ ├── enhancement.md │ ├── question.md │ └── bug_report.md ├── renovate.json └── workflows │ ├── auto-tag-latest.yml │ └── release.yml ├── devcontainer └── nix.conf ├── package.json ├── devenv-run-tests └── Cargo.toml ├── devenv.yaml ├── .gitignore ├── requirements.txt ├── .devcontainer.json ├── RELEASE.md ├── default.nix ├── .envrc ├── tailwind.config.js ├── filterOptions.nix └── Cargo.toml /docs/blog/index.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/ruby/.ruby-version: -------------------------------------------------------------------------------- 1 | 3.2.1 -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | devenv.lock 2 | -------------------------------------------------------------------------------- /examples/imports/devenv.nix: -------------------------------------------------------------------------------- 1 | { } 2 | -------------------------------------------------------------------------------- /examples/lean4/.gitignore: -------------------------------------------------------------------------------- 1 | test_proj -------------------------------------------------------------------------------- /examples/phoenix/.gitignore: -------------------------------------------------------------------------------- 1 | hello/ 2 | -------------------------------------------------------------------------------- /src/modules/latest-version: -------------------------------------------------------------------------------- 1 | 1.0.8 2 | -------------------------------------------------------------------------------- /tests/cli/.gitignore: -------------------------------------------------------------------------------- 1 | devenv.yaml 2 | -------------------------------------------------------------------------------- /examples/python-django/myapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/rubyonrails/.gitignore: -------------------------------------------------------------------------------- 1 | blog/ 2 | -------------------------------------------------------------------------------- /templates/simple/.gitignore: -------------------------------------------------------------------------------- 1 | .devenv 2 | -------------------------------------------------------------------------------- /templates/terraform/.gitignore: -------------------------------------------------------------------------------- 1 | .devenv 2 | -------------------------------------------------------------------------------- /tests/impure/devenv.yaml: -------------------------------------------------------------------------------- 1 | impure: true 2 | -------------------------------------------------------------------------------- /examples/android/devenv.yaml: -------------------------------------------------------------------------------- 1 | allowUnfree: true -------------------------------------------------------------------------------- /examples/python-django/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ -------------------------------------------------------------------------------- /examples/python-django/myproject/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/python/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | -------------------------------------------------------------------------------- /examples/vault/devenv.yaml: -------------------------------------------------------------------------------- 1 | allowUnfree: true 2 | -------------------------------------------------------------------------------- /templates/flake-parts/.gitignore: -------------------------------------------------------------------------------- 1 | .devenv 2 | -------------------------------------------------------------------------------- /examples/cockroachdb/devenv.yaml: -------------------------------------------------------------------------------- 1 | allowUnfree: true -------------------------------------------------------------------------------- /examples/python-django/myapp/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | devenv.lock 2 | devenv.local.nix 3 | -------------------------------------------------------------------------------- /examples/dynamodb-local/devenv.yaml: -------------------------------------------------------------------------------- 1 | allowUnfree: true 2 | -------------------------------------------------------------------------------- /examples/supported-languages/devenv.yaml: -------------------------------------------------------------------------------- 1 | allowUnfree: true -------------------------------------------------------------------------------- /tests/unversioned-devenv-nix/.gitignore: -------------------------------------------------------------------------------- 1 | devenv.nix 2 | -------------------------------------------------------------------------------- /tests/unversioned-devenv-nix/.test.sh: -------------------------------------------------------------------------------- 1 | echo $FOO | grep -q 1 -------------------------------------------------------------------------------- /xtask/src/cli.rs: -------------------------------------------------------------------------------- 1 | include!("../../devenv/src/cli.rs"); 2 | -------------------------------------------------------------------------------- /examples/imports/file.nix: -------------------------------------------------------------------------------- 1 | { 2 | env.FILE = "1"; 3 | } 4 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | xtask = "run --package xtask --" 3 | -------------------------------------------------------------------------------- /examples/compose/devenv.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | - ./projectA 3 | - ./projectB -------------------------------------------------------------------------------- /examples/imports/devenv.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | - ./file.nix 3 | - ./folder/ -------------------------------------------------------------------------------- /examples/imports/folder/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | env.FOLDER = "1"; 3 | } 4 | -------------------------------------------------------------------------------- /examples/simple-remote/.test.sh: -------------------------------------------------------------------------------- 1 | env | grep GREET 2 | env | grep GREET2 -------------------------------------------------------------------------------- /logos/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/.DS_Store -------------------------------------------------------------------------------- /tests/postgresql-localhost/.test.sh: -------------------------------------------------------------------------------- 1 | wait_for_port 2345 2 | pg_isready -d template1 -------------------------------------------------------------------------------- /tests/unversioned-devenv-nix/.patch.sh: -------------------------------------------------------------------------------- 1 | echo "{ env.FOO = "1"; }" > devenv.nix 2 | -------------------------------------------------------------------------------- /examples/compose/projectA/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | languages.python.enable = true; 3 | } 4 | -------------------------------------------------------------------------------- /examples/compose/projectB/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | languages.rust.enable = true; 3 | } 4 | -------------------------------------------------------------------------------- /examples/jsonnet/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | jsonnet --version 5 | -------------------------------------------------------------------------------- /examples/nur/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nur: 3 | url: github:nix-community/NUR 4 | -------------------------------------------------------------------------------- /examples/python-venv/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Devenv 3 | .devenv* 4 | devenv.local.nix 5 | 6 | -------------------------------------------------------------------------------- /examples/vault/devenv.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | { 3 | services.vault.enable = true; 4 | } 5 | -------------------------------------------------------------------------------- /docs/assets/logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/docs/assets/logo.webp -------------------------------------------------------------------------------- /examples/couchdb/devenv.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | { 3 | services.couchdb.enable = true; 4 | } 5 | -------------------------------------------------------------------------------- /examples/mailpit/devenv.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | { 3 | services.mailpit.enable = true; 4 | } 5 | -------------------------------------------------------------------------------- /examples/python-directory/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Devenv 3 | .devenv* 4 | devenv.local.nix 5 | 6 | -------------------------------------------------------------------------------- /examples/python-poetry/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Devenv 3 | .devenv* 4 | devenv.local.nix 5 | 6 | -------------------------------------------------------------------------------- /examples/rust-wasm-cross/.test.js: -------------------------------------------------------------------------------- 1 | import("./app/pkg/app.js").then((app) => app.main()); 2 | -------------------------------------------------------------------------------- /examples/rust/app/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, from devenv!"); 3 | } 4 | -------------------------------------------------------------------------------- /tests/cli/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, inputs, ... }: { 2 | languages.python.enable = true; 3 | } 4 | -------------------------------------------------------------------------------- /xtask/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod cli; 2 | pub mod manpage; 3 | pub mod shell_completion; 4 | -------------------------------------------------------------------------------- /examples/imports/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | env | grep "FILE=1" 3 | env | grep "FOLDER=1" -------------------------------------------------------------------------------- /examples/lean4/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | languages.lean4.enable = true; 5 | } 6 | -------------------------------------------------------------------------------- /logos/devenv-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/devenv-github.png -------------------------------------------------------------------------------- /logos/favicons/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/favicons/.DS_Store -------------------------------------------------------------------------------- /examples/meilisearch/devenv.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | services.meilisearch.enable = true; 5 | } 6 | -------------------------------------------------------------------------------- /examples/terraform/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | terraform --version | grep "1.8.4" 4 | -------------------------------------------------------------------------------- /logos/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/favicons/favicon.ico -------------------------------------------------------------------------------- /tests/gitignore/.setup.sh: -------------------------------------------------------------------------------- 1 | echo "{ env.LOCAL = \"1\";}" > devenv.local.nix 2 | echo "ENV=1" > .env 3 | -------------------------------------------------------------------------------- /_redirects: -------------------------------------------------------------------------------- 1 | /blog/2023/03/20/devenv-10-rewrite-in-rust/ /blog/2024/03/20/devenv-10-rewrite-in-rust/ 301 2 | -------------------------------------------------------------------------------- /docs/assets/images/cachix.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/docs/assets/images/cachix.webp -------------------------------------------------------------------------------- /docs/assets/images/nixcon.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/docs/assets/images/nixcon.webp -------------------------------------------------------------------------------- /examples/javascript/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | node -e "require('axios')" 6 | -------------------------------------------------------------------------------- /examples/minio/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | wait_for_port 9000 5 | mc admin info local -------------------------------------------------------------------------------- /examples/modern-c/README.md: -------------------------------------------------------------------------------- 1 | A demonstration of https://interrupt.memfault.com/blog/a-modern-c-dev-env 2 | -------------------------------------------------------------------------------- /examples/simple-remote/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | env.GREET2 = "Hello from Nix!"; 5 | } 6 | -------------------------------------------------------------------------------- /examples/simple/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nixpkgs: 3 | url: github:NixOS/nixpkgs/nixpkgs-unstable 4 | -------------------------------------------------------------------------------- /examples/javascript-bun/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | node -e "require('axios')" 6 | -------------------------------------------------------------------------------- /examples/javascript-pnpm/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | node -e "require('axios')" 6 | -------------------------------------------------------------------------------- /examples/javascript-yarn/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | node -e "require('axios')" 6 | -------------------------------------------------------------------------------- /examples/python-directory/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nixpkgs-python: 3 | url: github:cachix/nixpkgs-python 4 | -------------------------------------------------------------------------------- /examples/python-poetry/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nixpkgs-python: 3 | url: github:cachix/nixpkgs-python 4 | -------------------------------------------------------------------------------- /logos/devenv-light-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/devenv-light-vertical.png -------------------------------------------------------------------------------- /logos/favicons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/favicons/favicon-16x16.png -------------------------------------------------------------------------------- /logos/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /docs/assets/devenv-preview.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/docs/assets/devenv-preview.tar.gz -------------------------------------------------------------------------------- /logos/devenv-light-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/devenv-light-horizontal.png -------------------------------------------------------------------------------- /logos/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /examples/terraform/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nixpkgs-terraform: 3 | url: github:stackbuilders/nixpkgs-terraform 4 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /tests/gitignore/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: { 2 | dotenv.enable = true; 3 | 4 | env.BAR = "1"; 5 | } 6 | -------------------------------------------------------------------------------- /docs/assets/images/process-compose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/docs/assets/images/process-compose.png -------------------------------------------------------------------------------- /examples/mongodb/devenv.yaml: -------------------------------------------------------------------------------- 1 | allowUnfree: true 2 | inputs: 3 | nixpkgs: 4 | url: github:NixOS/nixpkgs/nixpkgs-unstable 5 | -------------------------------------------------------------------------------- /tests/glibcLocales/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | enterTest = '' 3 | locale -a | grep -E '(en_US.UTF-8|en_US.utf8)' 4 | ''; 5 | } 6 | -------------------------------------------------------------------------------- /docs/editor-support/zed.md: -------------------------------------------------------------------------------- 1 | Upvote [Zed issue for direnv support](https://github.com/zed-industries/zed/issues/4977). 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/javascript-directory/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | 5 | cd directory 6 | node -e "require('axios')" 7 | -------------------------------------------------------------------------------- /examples/nur/.envrc: -------------------------------------------------------------------------------- 1 | watch_file devenv.nix 2 | watch_file devenv.yaml 3 | watch_file devenv.lock 4 | eval "$(devenv print-dev-env)" -------------------------------------------------------------------------------- /logos/favicons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/favicons/android-chrome-192x192.png -------------------------------------------------------------------------------- /logos/favicons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dz0ny/devenv/main/logos/favicons/android-chrome-512x512.png -------------------------------------------------------------------------------- /tests/gitignore/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -xe 4 | 5 | env | grep BAR=1 6 | env | grep ENV=1 7 | env | grep LOCAL=1 -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | template: home.html 3 | title: Fast, Declarative, Reproducible, and Composable Developer Environments 4 | --- 5 | -------------------------------------------------------------------------------- /examples/android/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | android.enable = true; 5 | android.android-studio.enable = false; 6 | } 7 | -------------------------------------------------------------------------------- /tests/redis-socket/devenv.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | services.redis = { 5 | enable = true; 6 | port = 0; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/c.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/cue.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/elm.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/go.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/lua.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/nim.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/nix.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/php.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/r.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/v.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/zig.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /examples/clickhouse/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -xe 3 | 4 | wait_for_port 9000 5 | sleep 2 6 | clickhouse-client --query "SELECT 1" -------------------------------------------------------------------------------- /examples/lean4/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | rm -rf test_proj 5 | lake new test_proj 6 | cd test_proj 7 | lake exe test_proj -------------------------------------------------------------------------------- /examples/python/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | python --version | grep "3.11.3" 4 | python -c "import requests;print(requests)" -------------------------------------------------------------------------------- /examples/solidity/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | solc --version 4 | forge --version 5 | chisel --version 6 | anvil --version 7 | -------------------------------------------------------------------------------- /tests/dotenv/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | env | grep FOO=1 4 | env | grep BAR=1 5 | env | grep CHAZ=4 6 | env | grep BAZ=5 7 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/ansible.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/clojure.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/crystal.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/dart.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/deno.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/dotnet.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/elixir.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/erlang.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/fortran.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/gawk.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/gleam.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/haskell.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/idris.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/java.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/jsonnet.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/julia.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/kotlin.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/lean4.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/ocaml.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/odin.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/opentofu.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/pascal.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/perl.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/python.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/racket.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/raku.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/ruby.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/rust.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/scala.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/shell.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/solidity.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/swift.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/texlive.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/unison.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/vala.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/adminer.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/blackfire.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/caddy.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/cassandra.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/couchdb.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/elasticmq.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/httpbin.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/influxdb.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/mailhog.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/mailpit.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/memcached.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/minio.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/mongodb.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/mysql.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/nginx.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/postgres.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/rabbitmq.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/redis.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/temporal.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/typesense.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/varnish.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/vault.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/wiremock.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /examples/cockroachdb/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services.cockroachdb = { 5 | enable = pkgs.stdenv.isLinux; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /examples/python-venv/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | languages.python.enable = true; 5 | languages.python.venv.enable = true; 6 | } 7 | -------------------------------------------------------------------------------- /examples/rabbitmq/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | timeout 20 bash -c 'until rabbitmqctl -q status 2>/dev/null; do sleep 0.5; done' -------------------------------------------------------------------------------- /examples/scala/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | languages.java.jdk.package = pkgs.jdk11; 5 | languages.scala.enable = true; 6 | } 7 | -------------------------------------------------------------------------------- /src/modules/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | outputs = { ... }: { 3 | modules = ./.; 4 | isTmpDir = true; 5 | hasIsTesting = true; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | tasks: 2 | - command: | 3 | cachix use devenv 4 | nix build --accept-flake-config 5 | ./result/bin/devenv shell true 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/cplusplus.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/javascript.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/purescript.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/standardml.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/terraform.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/typescript.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/process-managers/honcho.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/clickhouse.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/cockroachdb.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/dynamodb-local.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/elasticsearch.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/meilisearch.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/opensearch.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/trafficserver.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /examples/compose/projectB/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | root: 3 | url: git+file://. 4 | flake: false 5 | imports: 6 | - root/examples/compose/projectA -------------------------------------------------------------------------------- /examples/postgres-timescale/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | timeout 20 bash -c 'until psql -c "SELECT 1" mydb; do sleep 0.5; done' 5 | -------------------------------------------------------------------------------- /examples/ruby/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | ruby "3.2.1" 6 | 7 | gem "rails" 8 | gem "puma" 9 | -------------------------------------------------------------------------------- /tests/dotenv/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | dotenv.enable = true; 3 | dotenv.filename = [ ".env" ".env.bar" ]; 4 | 5 | env.BAR = "1"; 6 | } 7 | -------------------------------------------------------------------------------- /docs/individual-docs/languages/robotframework.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/process-managers/hivemind.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/process-managers/overmind.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /examples/fly.io/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | if [ "$(uname -s)" == "Linux" ]; then 3 | devenv container shell 4 | devenv container processes 5 | fi -------------------------------------------------------------------------------- /examples/gleam/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | rm -rf test_proj 5 | gleam --version 6 | gleam new test_proj 7 | cd test_proj 8 | gleam test -------------------------------------------------------------------------------- /examples/minio/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | 5 | services.minio.enable = true; 6 | services.minio.buckets = [ "testbucket" ]; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /examples/rust/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | fenix: 3 | url: github:nix-community/fenix 4 | inputs: 5 | nixpkgs: 6 | follows: nixpkgs 7 | -------------------------------------------------------------------------------- /examples/shell/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | bash-language-server --version 4 | bats --version 5 | shellcheck --version 6 | shfmt --version 7 | -------------------------------------------------------------------------------- /examples/simple-remote/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | simple: 3 | url: github:cachix/devenv 4 | flake: false 5 | imports: 6 | - simple/examples/simple -------------------------------------------------------------------------------- /examples/solidity/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | { 3 | languages.solidity = { 4 | enable = true; 5 | foundry.enable = true; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /examples/terraform/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | languages.terraform = { 5 | enable = true; 6 | version = "1.8.4"; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /tests/clean/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | devenv: 3 | url: path:../../?dir=src/modules 4 | clean: 5 | enabled: true 6 | keep: 7 | - DEVENV_NIX 8 | -------------------------------------------------------------------------------- /devenv/init/.gitignore: -------------------------------------------------------------------------------- 1 | # Devenv 2 | .devenv* 3 | devenv.local.nix 4 | 5 | # direnv 6 | .direnv 7 | 8 | # pre-commit 9 | .pre-commit-config.yaml 10 | -------------------------------------------------------------------------------- /docs/individual-docs/process-managers/process-compose.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /docs/individual-docs/services/opentelemetry-collector.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [comment]: # (Please add your documentation on top of this line) 4 | 5 | @AUTOGEN_OPTIONS@ 6 | -------------------------------------------------------------------------------- /examples/jsonnet/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | languages.jsonnet.enable = true; 5 | enterShell = '' 6 | jsonnet --version 7 | ''; 8 | } 9 | -------------------------------------------------------------------------------- /examples/mysql/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | timeout 60 bash -c 'until MYSQL_PWD="" mysql -u root test_database < /dev/null; do sleep 0.5; done' -------------------------------------------------------------------------------- /examples/simple/.gitignore: -------------------------------------------------------------------------------- 1 | # Devenv 2 | .devenv* 3 | devenv.local.nix 4 | 5 | # direnv 6 | .direnv 7 | 8 | # pre-commit 9 | .pre-commit-config.yaml 10 | -------------------------------------------------------------------------------- /examples/solidity/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | foundry: 3 | url: github:shazow/foundry.nix 4 | inputs: 5 | nixpkgs: 6 | follows: nixpkgs 7 | -------------------------------------------------------------------------------- /src/modules/debug.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | { 3 | options.devenv = { 4 | debug = lib.mkEnableOption "debug mode of devenv enterShell script"; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /docs/blog/.authors.yml: -------------------------------------------------------------------------------- 1 | authors: 2 | domenkozar: 3 | name: Domen Kožar 4 | description: Cachix founder 5 | avatar: https://github.com/domenkozar.png 6 | -------------------------------------------------------------------------------- /examples/dynamodb-local/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services.dynamodb-local.enable = true; 5 | packages = [ 6 | pkgs.awscli2 7 | ]; 8 | } 9 | -------------------------------------------------------------------------------- /examples/overlays/subflake/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | outputs = { ... }: { 3 | overlays.default = self: super: { 4 | hello2 = self.hello; 5 | }; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /examples/python-django/myapp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | class Test(TestCase): 4 | def test(self): 5 | self.assertEqual(1, 1) 6 | -------------------------------------------------------------------------------- /examples/python/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nixpkgs-python: 3 | url: github:cachix/nixpkgs-python 4 | inputs: 5 | nixpkgs: 6 | follows: nixpkgs 7 | -------------------------------------------------------------------------------- /examples/rust-wasm-cross/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | fenix: 3 | url: github:nix-community/fenix 4 | inputs: 5 | nixpkgs: 6 | follows: nixpkgs 7 | -------------------------------------------------------------------------------- /tests/redis-socket/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | timeout 20 bash -c 'until redis-cli -s $REDIS_UNIX_SOCKET ping 2>/dev/null; do sleep 0.5; done' 5 | -------------------------------------------------------------------------------- /examples/postgres/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | echo $PGHOST 5 | 6 | timeout 20 bash -c 'until psql -c "SELECT 1" mydb 2>/dev/null; do sleep 0.5; done' -------------------------------------------------------------------------------- /examples/rabbitmq/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services.rabbitmq = { 5 | enable = true; 6 | managementPlugin = { enable = true; }; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /examples/rubyonrails/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nixpkgs-ruby: 3 | url: github:bobvanderlinden/nixpkgs-ruby 4 | inputs: 5 | nixpkgs: 6 | follows: nixpkgs -------------------------------------------------------------------------------- /examples/fly.io/hello.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route("/") 7 | def hello_world(): 8 | return "

Hello, World!

" 9 | -------------------------------------------------------------------------------- /examples/python-django/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nixpkgs-python: 3 | url: github:cachix/nixpkgs-python 4 | inputs: 5 | nixpkgs: 6 | follows: nixpkgs 7 | -------------------------------------------------------------------------------- /tests/dotenv/.setup.sh: -------------------------------------------------------------------------------- 1 | echo '{ env.LOCAL = "1";}' > devenv.local.nix 2 | cat < .env 3 | FOO=1 4 | BAR=2 5 | BAZ=3 6 | export CHAZ=4 7 | EOF 8 | echo 'BAZ=5' > .env.bar 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement 3 | about: What would you like devenv to do? 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /examples/texlive/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | languages.texlive = { 5 | enable = true; 6 | packages = [ "scheme-small" "biblatex" "latexmk" ]; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /examples/compose/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | enterTest = '' 3 | pushd projectB 4 | devenv shell python -- --version 5 | devenv shell cargo -- --version 6 | popd 7 | ''; 8 | } 9 | -------------------------------------------------------------------------------- /examples/httpbin/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | for port in 8080 8081; do 5 | wait_for_port "$port" 6 | curl -vf "http://127.0.0.1:$port/headers" 7 | done 8 | -------------------------------------------------------------------------------- /examples/mailpit/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | wait_for_port 1025 5 | 6 | sendmail john@example.com < 5 | {{ super() }} 6 | {% endblock %} -------------------------------------------------------------------------------- /examples/javascript-bun/.gitignore: -------------------------------------------------------------------------------- 1 | # Devenv 2 | .devenv* 3 | devenv.local.nix 4 | 5 | # JavaScript runtimes 6 | node_modules/ 7 | package-lock.json 8 | pnpm-lock.yaml 9 | yarn.lock 10 | bun.lockb 11 | -------------------------------------------------------------------------------- /examples/javascript-pnpm/.gitignore: -------------------------------------------------------------------------------- 1 | # Devenv 2 | .devenv* 3 | devenv.local.nix 4 | 5 | # JavaScript runtimes 6 | node_modules/ 7 | package-lock.json 8 | pnpm-lock.yaml 9 | yarn.lock 10 | bun.lockb 11 | -------------------------------------------------------------------------------- /examples/javascript-yarn/.gitignore: -------------------------------------------------------------------------------- 1 | # Devenv 2 | .devenv* 3 | devenv.local.nix 4 | 5 | # JavaScript runtimes 6 | node_modules/ 7 | package-lock.json 8 | pnpm-lock.yaml 9 | yarn.lock 10 | bun.lockb 11 | -------------------------------------------------------------------------------- /examples/phoenix/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | pushd hello 5 | wait_for_port 4000 60 6 | mix ecto.create 7 | curl -s http://localhost:4000/ | grep "Phoenix Framework" 8 | popd 9 | -------------------------------------------------------------------------------- /examples/javascript-directory/.gitignore: -------------------------------------------------------------------------------- 1 | # Devenv 2 | .devenv* 3 | devenv.local.nix 4 | 5 | # JavaScript runtimes 6 | node_modules/ 7 | package-lock.json 8 | pnpm-lock.yaml 9 | yarn.lock 10 | bun.lockb 11 | -------------------------------------------------------------------------------- /examples/supported-languages/.envrc: -------------------------------------------------------------------------------- 1 | source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0=" 2 | 3 | use devenv -------------------------------------------------------------------------------- /examples/android/.patch.sh: -------------------------------------------------------------------------------- 1 | echo "{ pkgs, lib, ... }: {" > devenv.local.nix 2 | echo " android.enable = lib.mkForce (pkgs.stdenv.isLinux && !pkgs.stdenv.isAarch64);" >> devenv.local.nix 3 | echo "}" >> devenv.local.nix 4 | 5 | -------------------------------------------------------------------------------- /examples/fly.io/devenv.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | nix2container: 3 | url: github:nlewo/nix2container 4 | inputs: 5 | nixpkgs: 6 | follows: nixpkgs 7 | mk-shell-bin: 8 | url: github:rrbutani/nix-mk-shell-bin -------------------------------------------------------------------------------- /examples/httpbin/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | packages = [ pkgs.curl ]; 5 | 6 | services.httpbin = { 7 | enable = true; 8 | bind = [ "127.0.0.1:8080" "127.0.0.1:8081" ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /examples/mongodb/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | 3 | { 4 | services.mongodb = { 5 | enable = true; 6 | initDatabaseUsername = "mongouser"; 7 | initDatabasePassword = "secret"; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /tests/python-native-libs/.test.sh: -------------------------------------------------------------------------------- 1 | python -c "from PIL import Image" 2 | python -c "import grpc_tools.protoc" 3 | python -c "import transformers" 4 | 5 | # TODO: invoke a subprocess with an old glibc and assert it doesn't crash -------------------------------------------------------------------------------- /examples/javascript/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | languages.javascript = { 5 | enable = true; 6 | npm = { 7 | enable = true; 8 | install.enable = true; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /examples/overlays/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | packages = [ 5 | # from the rust-overlay 6 | pkgs.rust-bin.stable.latest.default 7 | 8 | # from subflake 9 | pkgs.hello2 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /tests/python-native-libs-uv/.test.sh: -------------------------------------------------------------------------------- 1 | python -c "from PIL import Image" 2 | python -c "import grpc_tools.protoc" 3 | python -c "import transformers" 4 | 5 | # TODO: invoke a subprocess with an old glibc and assert it doesn't crash -------------------------------------------------------------------------------- /examples/javascript-bun/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | languages.javascript = { 5 | enable = true; 6 | bun = { 7 | enable = true; 8 | install.enable = true; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /examples/javascript-pnpm/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | languages.javascript = { 5 | enable = true; 6 | pnpm = { 7 | enable = true; 8 | install.enable = true; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /examples/javascript-yarn/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | languages.javascript = { 5 | enable = true; 6 | yarn = { 7 | enable = true; 8 | install.enable = true; 9 | }; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /tests/python-native-libs-poetry/.test.sh: -------------------------------------------------------------------------------- 1 | python -c "from PIL import Image" 2 | python -c "import grpc_tools.protoc" 3 | python -c "import transformers" 4 | 5 | # TODO: invoke a subprocess with an old glibc and assert it doesn't crash 6 | -------------------------------------------------------------------------------- /docs/editor-support/phpstorm.md: -------------------------------------------------------------------------------- 1 | It is recommend to use [automatic shell activation](../automatic-shell-activation.md) with the plugin [Devenv.​sh Support](https://plugins.jetbrains.com/plugin/23136-devenv-sh-support) for PHP development. 2 | -------------------------------------------------------------------------------- /examples/python/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | languages.python = { 5 | enable = true; 6 | version = "3.11.3"; 7 | 8 | venv.enable = true; 9 | venv.requirements = ./requirements.txt; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /examples/rubyonrails/.setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | gem install rails 5 | 6 | if [ ! -d "blog" ]; then 7 | rails new blog --database=postgresql --force 8 | fi 9 | 10 | pushd blog 11 | bundle 12 | popd 13 | -------------------------------------------------------------------------------- /examples/scripts/README.md: -------------------------------------------------------------------------------- 1 | Load the project: 2 | 3 | ``` 4 | $ devenv shell 5 | ``` 6 | 7 | Once in a shell, script `gitversion` is available in your `$PATH`: 8 | 9 | ``` 10 | $ gitversion 11 | hello git git version 2.36.2 12 | ``` -------------------------------------------------------------------------------- /tests/python-native-libs-poetry/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: { 2 | packages = [ pkgs.cairo ]; 3 | 4 | languages.python = { 5 | enable = true; 6 | directory = "subdir"; 7 | poetry.enable = true; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /docs/supported-services/trafficserver.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | 7 | -------------------------------------------------------------------------------- /devenv-run-tests/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "devenv-run-tests" 3 | version = "0.1.0" 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | clap.workspace = true 8 | tempdir.workspace = true 9 | 10 | devenv= { path = "../devenv" } 11 | -------------------------------------------------------------------------------- /devenv.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=./docs/devenv.schema.json 2 | inputs: 3 | devenv: 4 | url: path:.?dir=src/modules 5 | nix: 6 | url: github:domenkozar/nix/devenv-2.21 7 | inputs: 8 | nixpkgs: 9 | follows: nixpkgs -------------------------------------------------------------------------------- /examples/overlays/devenv.yaml: -------------------------------------------------------------------------------- 1 | allowUnfree: true 2 | inputs: 3 | subflake: 4 | url: path:./subflake 5 | overlays: 6 | - default 7 | rust-overlay: 8 | url: github:oxalica/rust-overlay 9 | overlays: 10 | - default -------------------------------------------------------------------------------- /examples/rubyonrails/README.md: -------------------------------------------------------------------------------- 1 | Based on [the official tutorial](https://guides.rubyonrails.org/getting_started.html). 2 | 3 | ```shell-session 4 | $ devenv shell 5 | $ rails new blog -d=postgresql 6 | $ devenv up 7 | $ cd blog && rails db:create 8 | ``` -------------------------------------------------------------------------------- /tests/postgres-pghost/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.postgres = { 3 | enable = true; 4 | listen_addresses = "*"; 5 | port = 2345; 6 | initialScript = '' 7 | CREATE USER postgres SUPERUSER; 8 | ''; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /examples/opentelemetry-collector/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | endpoint="http://localhost:13133/" 5 | 6 | timeout 20 bash -c "until curl $endpoint 2>/dev/null; do sleep 0.5; done" 7 | curl -s "$endpoint" | grep "Server available" 8 | -------------------------------------------------------------------------------- /examples/shell/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | languages.shell.enable = true; 5 | enterShell = '' 6 | bash-language-server --version 7 | bats --version 8 | shellcheck --version 9 | shfmt --version 10 | ''; 11 | } 12 | -------------------------------------------------------------------------------- /examples/rust/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | cargo --version 4 | rustc --version 5 | 6 | [[ "$CARGO_INSTALL_ROOT" == "$DEVENV_STATE/cargo-install" ]] 7 | echo "$PATH" | grep -- "$CARGO_INSTALL_ROOT/bin" 8 | 9 | cd app 10 | cargo run 11 | -------------------------------------------------------------------------------- /tests/postgresql-localhost/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.postgres = { 3 | enable = true; 4 | listen_addresses = "localhost"; 5 | port = 2345; 6 | initialScript = '' 7 | CREATE USER postgres SUPERUSER; 8 | ''; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /examples/rust/app/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "app" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | 10 | 11 | [workspace] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Nix & devenv 2 | result 3 | .env 4 | .env.* 5 | .devenv* 6 | .direnv* 7 | /.cache 8 | /.pre-commit-config.yaml 9 | man 10 | 11 | # examples 12 | examples/rust/app/target 13 | 14 | # Rust 15 | target 16 | 17 | # JavaScript 18 | /node_modules 19 | -------------------------------------------------------------------------------- /examples/elasticmq/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | packages = [ 5 | pkgs.jq 6 | ]; 7 | 8 | services.elasticmq.enable = true; 9 | services.elasticmq.settings = '' 10 | queues { 11 | test-queue {} 12 | } 13 | ''; 14 | } 15 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | mkdocs 2 | mkdocs-material[imaging] 3 | # https://github.com/Guts/mkdocs-rss-plugin/issues/257#issuecomment-2170940396 4 | mkdocs-rss-plugin==1.13.1 5 | mkdocs-include-markdown-plugin 6 | mkdocs-markdownextradata-plugin 7 | mkdocs-awesome-pages-plugin 8 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ], 6 | "nix": { 7 | "enabled": true 8 | }, 9 | "lockFileMaintenance": { 10 | "enabled": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/starship/starship.toml: -------------------------------------------------------------------------------- 1 | # Replace the '❯' symbol in the prompt with '➜' 2 | [character] # The name of the module we are configuring is 'character' 3 | success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green' 4 | -------------------------------------------------------------------------------- /examples/gleam/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | # https://devenv.sh/languages/ 5 | languages.gleam.enable = true; 6 | 7 | enterShell = '' 8 | gleam --version 9 | ''; 10 | 11 | # See full reference at https://devenv.sh/reference/options/ 12 | } 13 | -------------------------------------------------------------------------------- /xtask/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "xtask" 3 | version = "0.1.0" 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | clap.workspace = true 8 | clap_complete = "4.5.7" 9 | clap_mangen = "0.2.22" 10 | devenv = { path = "../devenv" } 11 | miette.workspace = true 12 | -------------------------------------------------------------------------------- /examples/nur/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, inputs, config, ... }: 2 | 3 | { 4 | imports = [ inputs.nur.nixosModules.nur ]; 5 | 6 | # see the list of repos at https://nur.nix-community.org/documentation/ 7 | packages = [ 8 | config.nur.repos.mic92.hello-nur 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /docs/integrations/delta.md: -------------------------------------------------------------------------------- 1 | To get started using [Delta, a syntax-highlighting pager for git, diff, and grep output](https://dandavison.github.io/delta/), flip a toggle: 2 | 3 | ```nix title="devenv.nix" 4 | { pkgs, ... }: 5 | 6 | { 7 | delta.enable = true; 8 | } 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/perl/devenv.nix: -------------------------------------------------------------------------------- 1 | _: 2 | 3 | { 4 | languages.perl.enable = true; 5 | languages.perl.packages = [ "Mojolicious" "Text::Markdown::Hoedown" ]; 6 | enterShell = '' 7 | perl -MText::Markdown::Hoedown -Mojo -e 'say c(1,2,markdown("hey"))->join(" ")' 8 | ''; 9 | } 10 | -------------------------------------------------------------------------------- /examples/ruby/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | ruby --version | grep "$(cat .ruby-version)" 4 | ruby -e "puts RUBY_VERSION" | grep "$(cat .ruby-version)" 5 | ruby -e "require 'puma'" 6 | bundle --version 7 | bundle exec ruby -e "puts RUBY_VERSION" | grep "$(cat .ruby-version)" 8 | -------------------------------------------------------------------------------- /.devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "customizations": { 3 | "vscode": { 4 | "extensions": [ 5 | "jnoortheen.nix-ide" 6 | ] 7 | } 8 | }, 9 | "image": "ghcr.io/cachix/devenv:latest", 10 | "overrideCommand": false, 11 | "updateContentCommand": "devenv test" 12 | } 13 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | - write a blog post 2 | - bump version in devenv/Cargo.toml 3 | - `cargo build` 4 | - bump version in package.nix 5 | - git commit 6 | - git tag 7 | - git push --tags 8 | - create a release on github 9 | 10 | # Once nixpkgs has been updated 11 | 12 | - src/modules/latest-version -------------------------------------------------------------------------------- /examples/rubyonrails/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | pushd blog 5 | rails db:create 6 | popd 7 | 8 | wait_for_port 3000 9 | curl -s http://localhost:3000/ | grep "version" 10 | 11 | # make sure puma was compiled with ssl 12 | ruby -rpuma -e 'exit 1 unless Puma.ssl?' 13 | -------------------------------------------------------------------------------- /tests/clean/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | enterTest = '' 3 | if [ -z "$DEVENV_NIX" ]; then 4 | echo "DEVENV_NIX is not set" 5 | exit 1 6 | fi 7 | 8 | set +u 9 | if [ ! -z "$BROWSER" ]; then 10 | echo "BROWSER is set" 11 | exit 1 12 | fi 13 | ''; 14 | } 15 | -------------------------------------------------------------------------------- /tests/mysql/.test.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | wait_for_port 3306 4 | 5 | # Wait for configure-mysql to finish. 6 | sleep 5 7 | 8 | # through unix_socket 9 | mysql -e 'SELECT VERSION()' 10 | 11 | # through tcp/ip 12 | mysql -h "127.0.0.1" -udb -pdb -e 'SELECT VERSION()' 13 | 14 | ping-mysql 15 | -------------------------------------------------------------------------------- /examples/elasticmq/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | wait_for_port 9325 60 5 | 6 | QUEUE_NAME=$(curl http://localhost:9325/statistics/queues -s | jq .[].name -r) 7 | 8 | if [[ "$QUEUE_NAME" != "test-queue" ]]; then 9 | echo "The queue is not created" 10 | exit 1 11 | fi 12 | -------------------------------------------------------------------------------- /examples/javascript-directory/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | languages.javascript = { 5 | enable = true; 6 | directory = "directory"; 7 | package = pkgs.nodejs-slim; 8 | npm = { 9 | enable = true; 10 | install.enable = true; 11 | }; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /examples/python-directory/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | 3 | { 4 | languages.python = { 5 | enable = true; 6 | directory = "./directory"; 7 | poetry = { 8 | enable = true; 9 | install.enable = true; 10 | activate.enable = true; 11 | }; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /tests/python-native-libs/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: { 2 | packages = [ pkgs.cairo ]; 3 | 4 | languages.python = { 5 | enable = true; 6 | venv.enable = true; 7 | venv.requirements = '' 8 | pillow 9 | grpcio-tools 10 | transformers 11 | ''; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /tests/up-uses-shell/devenv.nix: -------------------------------------------------------------------------------- 1 | { 2 | enterShell = '' 3 | export FOO=1 4 | ''; 5 | 6 | enterTest = '' 7 | sleep 1 8 | if [ $(cat foo) -ne 1 ]; then 9 | exit 1 10 | fi 11 | ''; 12 | 13 | processes.test.exec = "while true; do echo $FOO > foo; sleep 1; done"; 14 | } 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question 4 | title: '' 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | See https://devenv.sh/community/get-involved/ for how to get in contact with the community. 11 | 12 | Feel free to also post a question here. 13 | -------------------------------------------------------------------------------- /.github/workflows/auto-tag-latest.yml: -------------------------------------------------------------------------------- 1 | name: "Latest tag" 2 | on: 3 | push: 4 | tags: 5 | - v** 6 | jobs: 7 | latest-tag: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v4 11 | - name: Update 'latest' git tag 12 | uses: EndBug/latest-tag@latest 13 | -------------------------------------------------------------------------------- /examples/dynamodb-local/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | export AWS_DEFAULT_REGION=fakeRegion 5 | export AWS_ACCESS_KEY_ID=fakeMyKeyId 6 | export AWS_SECRET_ACCESS_KEY=fakeSecretAccessKey 7 | 8 | wait_for_port 8000 9 | 10 | aws dynamodb list-tables --endpoint-url http://localhost:8000 11 | -------------------------------------------------------------------------------- /examples/rust-wasm-cross/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | cargo --version 4 | rustc --version 5 | 6 | [[ "$CARGO_INSTALL_ROOT" == "$DEVENV_STATE/cargo-install" ]] 7 | echo "$PATH" | grep -- "$CARGO_INSTALL_ROOT/bin" 8 | 9 | wasm-pack build ./app --target nodejs 10 | 11 | node .test.js 12 | -------------------------------------------------------------------------------- /examples/modern-c/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: { 2 | languages.c.enable = true; 3 | 4 | packages = [ pkgs.cmake pkgs.ceedling ]; 5 | 6 | enterShell = '' 7 | cmake --version 8 | ''; 9 | 10 | pre-commit.excludes = [ ".devenv" ]; 11 | pre-commit.hooks = { 12 | clang-tidy.enable = true; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /tests/python-native-libs-uv/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: { 2 | packages = [ pkgs.cairo ]; 3 | 4 | languages.python = { 5 | enable = true; 6 | venv.enable = true; 7 | venv.requirements = '' 8 | pillow 9 | grpcio-tools 10 | transformers 11 | ''; 12 | uv.enable = true; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /examples/temporal/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | services.temporal = { 4 | enable = true; 5 | 6 | port = 17233; 7 | 8 | namespaces = [ "mynamespace" ]; 9 | 10 | state = { 11 | ephemeral = false; 12 | sqlite-pragma = { 13 | journal_mode = "wal"; 14 | }; 15 | }; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /examples/fly.io/fly.toml: -------------------------------------------------------------------------------- 1 | app = "simple-python-app" 2 | 3 | [build] 4 | image = "registry.fly.io/simple-python-app:latest" 5 | 6 | [[services]] 7 | internal_port = 5000 8 | protocol = "tcp" 9 | 10 | [[services.ports]] 11 | handlers = ["tls", "http"] 12 | port = "443" 13 | 14 | [mounts] 15 | source="devenv_state" 16 | destination="/.devenv/state" -------------------------------------------------------------------------------- /examples/javascript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "javascript", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^1.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/javascript-bun/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "javascript", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^1.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/javascript-pnpm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "javascript", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^1.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/javascript-yarn/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "javascript", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^1.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | (import 2 | ( 3 | let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in 4 | fetchTarball { 5 | url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; 6 | sha256 = lock.nodes.flake-compat.locked.narHash; 7 | } 8 | ) 9 | { src = ./.; } 10 | ).defaultNix 11 | -------------------------------------------------------------------------------- /examples/influxdb/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | wait_for_port 8087 60 5 | 6 | influx --port 8087 --execute "CREATE DATABASE devenv" 7 | DATABASES=$(influx --port 8087 --execute "SHOW DATABASES" | grep devenv) 8 | 9 | if [[ "$DATABASES" != "devenv" ]]; then 10 | echo "The influxdb database was not created" 11 | exit 1 12 | fi 13 | -------------------------------------------------------------------------------- /src/modules/languages/raku.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.raku; 5 | in 6 | { 7 | options.languages.raku = { 8 | enable = lib.mkEnableOption "tools for Raku development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = with pkgs; [ 13 | rakudo 14 | ]; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /tests/postgres-pghost/.test.sh: -------------------------------------------------------------------------------- 1 | wait_for_port 2345 2 | psql postgres -c '\q' &> /dev/null 3 | 4 | # Check the exit status of the psql command 5 | if [ $? -eq 0 ]; then 6 | echo "listen_address and PGHOST is valid, connection successful" 7 | exit 0 8 | else 9 | echo "listen_address and PGHOST is invalid, connection failed" 10 | exit 1 11 | fi -------------------------------------------------------------------------------- /examples/javascript-directory/directory/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "javascript", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^1.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs/examples.md: -------------------------------------------------------------------------------- 1 | There are a few examples [in the devenv repository](https://github.com/cachix/devenv/tree/main/examples). 2 | 3 | [The devenv project itself uses devenv, which serves as an example](https://github.com/cachix/devenv/blob/main/devenv.nix). 4 | 5 | If you're searching for an example but can't find it, [let us know](https://github.com/cachix/devenv/issues/12). 6 | -------------------------------------------------------------------------------- /examples/postgres/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | packages = [ pkgs.coreutils ]; 5 | services.postgres = { 6 | enable = true; 7 | extensions = extensions: [ extensions.postgis ]; 8 | 9 | initialDatabases = [{ name = "mydb"; }]; 10 | 11 | initialScript = '' 12 | CREATE EXTENSION IF NOT EXISTS postgis; 13 | ''; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /src/modules/languages/jsonnet.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.jsonnet; 5 | in 6 | { 7 | options.languages.jsonnet = { 8 | enable = lib.mkEnableOption "tools for jsonnet development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = with pkgs; [ 13 | go-jsonnet 14 | ]; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /examples/python-directory/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -exu 3 | POETRY_VENV="$PWD/directory/.venv" 4 | [ -d "$POETRY_VENV" ] 5 | [ "$(command -v python)" = "$POETRY_VENV/bin/python" ] 6 | python --version 7 | poetry --version 8 | python -c 'import requests' 9 | cd directory 10 | [ "$(poetry env info --path)" = "$POETRY_VENV" ] 11 | poetry run python -c 'import requests' -------------------------------------------------------------------------------- /src/modules/languages/typescript.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.typescript; 5 | in 6 | { 7 | options.languages.typescript = { 8 | enable = lib.mkEnableOption "tools for TypeScript development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = [ 13 | pkgs.typescript 14 | ]; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /src/modules/languages/kotlin.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.kotlin; 5 | in 6 | { 7 | options.languages.kotlin = { 8 | enable = lib.mkEnableOption "tools for Kotlin development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = with pkgs; [ 13 | kotlin 14 | gradle 15 | ]; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /src/modules/languages/gawk.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.gawk; 5 | in 6 | { 7 | options.languages.gawk = { 8 | enable = lib.mkEnableOption "tools for GNU Awk development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = with pkgs; [ 13 | gawk 14 | gawkextlib.gawkextlib 15 | ]; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /src/modules/languages/cplusplus.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.cplusplus; 5 | in 6 | { 7 | options.languages.cplusplus = { 8 | enable = lib.mkEnableOption "tools for C++ development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = with pkgs; [ 13 | cmake 14 | clang 15 | ccls 16 | ]; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /examples/phoenix/.setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | mix local.hex --force 5 | mix local.rebar --force 6 | mix archive.install --force hex phx_new 7 | 8 | if [ ! -d "hello" ]; then 9 | echo y | mix phx.new --install hello 10 | sed -i -e "s/hostname: \"localhost\"/socket_dir: System.get_env(\"PGHOST\")/" ./hello/config/dev.exs 11 | fi 12 | 13 | pushd hello 14 | mix deps.get 15 | popd 16 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # ^ for code highlighting 3 | # Used by https://direnv.net 4 | set -euo pipefail 5 | 6 | # Use our own last built devenv/nix in CLI 7 | nix build --print-out-paths --accept-flake-config || echo "nix build failed, using previous build" 8 | PATH_add "result/bin" 9 | 10 | # External users should use `source_url` to load this file 11 | source_env ./direnvrc 12 | 13 | use devenv 14 | -------------------------------------------------------------------------------- /examples/trafficserver/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | # This might help if Traffic Server crashes early 5 | onExit() { 6 | local logdir f 7 | logdir="$(traffic_layout info --json | jq -r .LOGDIR)" 8 | for f in "$logdir"/*; do 9 | cat "$f" 10 | done 11 | } 12 | 13 | trap onExit EXIT 14 | 15 | wait_for_port 8080 16 | curl -vf --max-time 60 http://localhost:8080/nocache/32 17 | -------------------------------------------------------------------------------- /src/modules/integrations/delta.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | { 4 | options.delta.enable = lib.mkOption { 5 | type = lib.types.bool; 6 | default = false; 7 | description = "Integrate delta into git: https://dandavison.github.io/delta/."; 8 | }; 9 | 10 | config = lib.mkIf config.delta.enable { 11 | packages = [ pkgs.delta ]; 12 | 13 | env.GIT_PAGER = "delta"; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | './docs/**/*.{js,html}' 5 | ], 6 | theme: { 7 | extend: {}, 8 | }, 9 | plugins: [ 10 | require('tailwindcss-base-font-size')({ 11 | // mkdocs uses 20px as the base font size. 12 | // Rescale tailwind to match this. 13 | baseFontSize: 20, 14 | }), 15 | ], 16 | } 17 | 18 | -------------------------------------------------------------------------------- /examples/varnish/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | wait_for_port 6081 5 | 6 | caddy=$(curl http://localhost:8001) 7 | varnish=$(curl http://localhost:6081) 8 | 9 | if [[ "$caddy" == "$varnish" ]]; then 10 | echo "Everything running"; 11 | else 12 | echo "Caddy response does not match Varnish"; 13 | echo "Caddy response: ${caddy}" 14 | echo "Varnish response: ${varnish}" 15 | exit 1 16 | fi 17 | -------------------------------------------------------------------------------- /docs/integrations/codespaces-devcontainer.md: -------------------------------------------------------------------------------- 1 | To get started using [Codespaces](https://github.com/features/codespaces), flip a toggle: 2 | 3 | 4 | ```nix title="devenv.nix" 5 | { pkgs, ... }: 6 | 7 | { 8 | devcontainer.enable = true; 9 | } 10 | ``` 11 | 12 | Run ``devenv shell``. You should see an autogenerated `.devcontainer.json` file. 13 | 14 | 15 | Commit `.devcontainer.json` to the Git repository and push it. 16 | -------------------------------------------------------------------------------- /examples/wiremock/devenv.nix: -------------------------------------------------------------------------------- 1 | { ... }: 2 | 3 | { 4 | services.wiremock = { 5 | enable = true; 6 | mappings = [ 7 | { 8 | request = { 9 | method = "GET"; 10 | url = "/"; 11 | }; 12 | response = { 13 | status = 200; 14 | headers."Content-Type" = "text/plain"; 15 | body = "Hello World!"; 16 | }; 17 | } 18 | ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /examples/rust-wasm-cross/app/Cargo.toml: -------------------------------------------------------------------------------- 1 | [lib] 2 | crate-type = ["cdylib", "rlib"] 3 | 4 | [package] 5 | name = "app" 6 | version = "0.1.0" 7 | edition = "2021" 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | [dependencies] 12 | wasm-bindgen = "0.2.84" 13 | 14 | [profile.release] 15 | # Tell `rustc` to optimize for small code size. 16 | opt-level = "s" 17 | 18 | [workspace] 19 | -------------------------------------------------------------------------------- /src/modules/integrations/difftastic.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | { 4 | options.difftastic.enable = lib.mkOption { 5 | type = lib.types.bool; 6 | default = false; 7 | description = "Integrate difftastic into git: https://difftastic.wilfred.me.uk/."; 8 | }; 9 | 10 | config = lib.mkIf config.difftastic.enable { 11 | packages = [ pkgs.difftastic ]; 12 | 13 | env.GIT_EXTERNAL_DIFF = "difft"; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /examples/aws-vault/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | # Since Terraform adopted a non-free license (BSL 1.1) in August 2023, 5 | # using terraform instead of opentofu now requires adding `allowUnfree: true` to `devenv.yaml` 6 | languages.opentofu.enable = true; 7 | 8 | aws-vault = { 9 | enable = true; 10 | profile = "aws-profile"; 11 | awscliWrapper.enable = true; 12 | opentofuWrapper.enable = true; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /examples/python-poetry/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["poetry-core"] 3 | build-backend = "poetry.core.masonry.api" 4 | 5 | [tool.poetry] 6 | name = "python-poetry" 7 | version = "0.2.0" 8 | description = "" 9 | authors = [ 10 | "Bob van der Linden ", 11 | "Matthias Thym " 12 | ] 13 | readme = "README.md" 14 | 15 | [tool.poetry.dependencies] 16 | python = "^3.10" 17 | numpy = "^1.24.1" 18 | -------------------------------------------------------------------------------- /docs/supported-languages/elm.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.elm\.enable 7 | 8 | Whether to enable tools for Elm development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /docs/supported-languages/raku.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.raku\.enable 7 | 8 | Whether to enable tools for Raku development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /examples/python-poetry/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -exu 3 | 4 | POETRY_VENV="$PWD/.venv" 5 | [ -d "$POETRY_VENV" ] 6 | [ "$(poetry env info --path)" = "$POETRY_VENV" ] 7 | [ "$(command -v python)" = "$POETRY_VENV/bin/python" ] 8 | python --version 9 | poetry --version 10 | poetry run python -c "import os; print(os.environ['LD_LIBRARY_PATH'])" 11 | poetry run python -c 'import numpy' 12 | python -c 'import numpy' 13 | python -c 'import pjsua2' 14 | -------------------------------------------------------------------------------- /docs/supported-languages/gawk.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.gawk\.enable 7 | 8 | Whether to enable tools for GNU Awk development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /docs/supported-languages/kotlin.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.kotlin\.enable 7 | 8 | Whether to enable tools for Kotlin development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /docs/supported-languages/shell.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.shell\.enable 7 | 8 | Whether to enable tools for shell development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /examples/postgres-timescale/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | services.postgres = { 5 | enable = true; 6 | package = pkgs.postgresql_15; 7 | initialDatabases = [{ name = "mydb"; }]; 8 | extensions = extensions: [ 9 | extensions.postgis 10 | extensions.timescaledb 11 | ]; 12 | settings.shared_preload_libraries = "timescaledb"; 13 | initialScript = "CREATE EXTENSION IF NOT EXISTS timescaledb;"; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /examples/python-django/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "myproject" 3 | version = "0.1.0" 4 | description = "" 5 | authors = ["Rowan Molony "] 6 | readme = "README.md" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.10" 10 | Django = "^4.2.15" 11 | django-environ = "^0.9.0" 12 | psycopg2-binary = "^2.9.5" 13 | 14 | 15 | [build-system] 16 | requires = ["poetry-core"] 17 | build-backend = "poetry.core.masonry.api" 18 | -------------------------------------------------------------------------------- /docs/supported-languages/clojure.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.clojure\.enable 7 | 8 | Whether to enable tools for Clojure development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /docs/supported-languages/cplusplus.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.cplusplus\.enable 7 | 8 | Whether to enable tools for C++ development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /docs/supported-languages/jsonnet.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.jsonnet\.enable 7 | 8 | Whether to enable tools for jsonnet development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /examples/python-directory/directory/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["poetry-core"] 3 | build-backend = "poetry.core.masonry.api" 4 | 5 | [tool.poetry] 6 | name = "python-directory" 7 | version = "0.1.0" 8 | description = "" 9 | authors = [ 10 | "Bob van der Linden ", 11 | "Matthias Thym " 12 | ] 13 | readme = "README.md" 14 | 15 | [tool.poetry.dependencies] 16 | python = "^3.11" 17 | requests = "^2.30" 18 | -------------------------------------------------------------------------------- /docs/supported-languages/crystal.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.crystal\.enable 7 | 8 | Whether to enable Enable tools for Crystal development… 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /tests/python-native-libs-poetry/subdir/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "python-native-libs-poetry" 3 | version = "0.1.0" 4 | description = "" 5 | authors = ["Your Name "] 6 | readme = "README.md" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.11" 10 | pillow = "^10.4.0" 11 | grpcio-tools = "^1.65.1" 12 | transformers = "^4.42.4" 13 | 14 | 15 | [build-system] 16 | requires = ["poetry-core"] 17 | build-backend = "poetry.core.masonry.api" 18 | -------------------------------------------------------------------------------- /docs/supported-languages/typescript.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.typescript\.enable 7 | 8 | Whether to enable tools for TypeScript development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | -------------------------------------------------------------------------------- /examples/varnish/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | services.varnish = { 4 | enable = true; 5 | package = pkgs.varnish; 6 | vcl = '' 7 | vcl 4.0; 8 | 9 | backend default { 10 | .host = "127.0.0.1"; 11 | .port = "8001"; 12 | } 13 | ''; 14 | }; 15 | 16 | services.caddy.enable = true; 17 | services.caddy.virtualHosts.":8001" = { 18 | extraConfig = '' 19 | respond "Hello, world!" 20 | ''; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /src/modules/languages/elm.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.elm; 5 | in 6 | { 7 | options.languages.elm = { 8 | enable = lib.mkEnableOption "tools for Elm development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = with pkgs; [ 13 | elmPackages.elm 14 | elmPackages.elm-format 15 | elmPackages.elm-test 16 | elmPackages.elm-language-server 17 | elm2nix 18 | ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /examples/mysql/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | 3 | { 4 | services.mysql.enable = true; 5 | # The default is MariaDB. To use MySQL instead: 6 | # services.mysql.package = pkgs.mysql80; 7 | services.mysql.initialDatabases = [{ name = "test_database"; }]; 8 | services.mysql.ensureUsers = [ 9 | { 10 | name = "test_database"; 11 | password = "test_database"; 12 | ensurePermissions = { "test_database.*" = "ALL PRIVILEGES"; }; 13 | } 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /devenv/init/devenv.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://devenv.sh/devenv.schema.json 2 | inputs: 3 | nixpkgs: 4 | url: github:cachix/devenv-nixpkgs/rolling 5 | 6 | # If you're using non-OSS software, you can set allowUnfree to true. 7 | # allowUnfree: true 8 | 9 | # If you're willing to use a package that's vulnerable 10 | # permittedInsecurePackages: 11 | # - "openssl-1.1.1w" 12 | 13 | # If you have more than one devenv you can merge them 14 | #imports: 15 | # - ./backend 16 | -------------------------------------------------------------------------------- /examples/phoenix/README.md: -------------------------------------------------------------------------------- 1 | Based on [the official tutorial](https://hexdocs.pm/phoenix/installation.html). 2 | 3 | ```shell-session 4 | $ devenv shell 5 | $ mix local.hex --force 6 | $ mix local.rebar --force 7 | $ mix archive.install hex phx_new 8 | $ mix phx.new --install hello 9 | $ sed -i.bak -e "s/hostname: \"localhost\"/socket_dir: System.get_env(\"PGHOST\")/" \ 10 | ./hello/config/dev.exs && rm ./hello/config/dev.exs.bak 11 | $ devenv up 12 | $ cd hello && mix ecto.create 13 | ``` 14 | -------------------------------------------------------------------------------- /templates/simple/.envrc: -------------------------------------------------------------------------------- 1 | if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then 2 | source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" 3 | fi 4 | 5 | watch_file flake.nix 6 | watch_file flake.lock 7 | if ! use flake . --impure 8 | then 9 | echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 10 | fi 11 | -------------------------------------------------------------------------------- /examples/python-django/myproject/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for myproject project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /examples/python-django/myproject/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for myproject project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /docs/integrations/difftastic.md: -------------------------------------------------------------------------------- 1 | To get started using [Difftastic, a structural diff that understands syntax for over 30 languages](https://difftastic.wilfred.me.uk/), flip a toggle: 2 | 3 | 4 | ```nix title="devenv.nix" 5 | { pkgs, ... }: 6 | 7 | { 8 | difftastic.enable = true; 9 | } 10 | ``` 11 | 12 | When you run `devenv shell` using `git diff`, you should see the following output: 13 | 14 | 15 | ![Screenshot of difftastic and JS](https://github.com/Wilfred/difftastic/raw/master/img/js.png) 16 | -------------------------------------------------------------------------------- /src/modules/languages/clojure.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.clojure; 5 | in 6 | { 7 | options.languages.clojure = { 8 | enable = lib.mkEnableOption "tools for Clojure development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = with pkgs; [ 13 | (clojure.override { 14 | jdk = config.languages.java.jdk.package; 15 | }) 16 | clojure-lsp 17 | ]; 18 | languages.java.enable = true; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /src/modules/languages/shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.shell; 5 | in 6 | { 7 | options.languages.shell = { 8 | enable = lib.mkEnableOption "tools for shell development"; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | packages = with pkgs; [ 13 | (pkgs.bats.withLibraries (p: [ p.bats-assert p.bats-file p.bats-support ])) 14 | nodePackages.bash-language-server 15 | shellcheck 16 | shfmt 17 | ]; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /examples/trafficserver/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | packages = [ pkgs.curl pkgs.jq ]; 5 | 6 | services.trafficserver = { 7 | enable = true; 8 | remap = "map / http://127.0.0.1 @plugin=generator.so"; 9 | records.proxy.config = { 10 | proxy_name = "devenv.test"; 11 | http.server_ports = "8080 8080:ipv6"; 12 | 13 | diags.logfile.filename = "stdout"; 14 | error.logfile.filename = "stderr"; 15 | 16 | admin.user_id = "#-1"; 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /src/modules/languages/crystal.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.crystal; 5 | in 6 | { 7 | options.languages.crystal = { 8 | enable = lib.mkEnableOption "Enable tools for Crystal development."; 9 | }; 10 | 11 | config = lib.mkIf cfg.enable { 12 | # enable compiler tooling by default to expose things like cc 13 | languages.c.enable = lib.mkDefault true; 14 | 15 | packages = [ 16 | pkgs.crystal 17 | pkgs.shards 18 | ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /templates/terraform/.envrc: -------------------------------------------------------------------------------- 1 | if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then 2 | source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" 3 | fi 4 | 5 | nix_direnv_watch_file flake.nix 6 | nix_direnv_watch_file flake.lock 7 | if ! use flake . --impure 8 | then 9 | echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 10 | fi 11 | -------------------------------------------------------------------------------- /examples/rust/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | languages.rust = { 5 | enable = true; 6 | # https://devenv.sh/reference/options/#languagesrustchannel 7 | channel = "nightly"; 8 | 9 | components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" ]; 10 | }; 11 | 12 | #pre-commit.hooks = { 13 | # rustfmt.enable = true; 14 | # clippy.enable = true; 15 | #}; 16 | 17 | packages = lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [ 18 | frameworks.Security 19 | ]); 20 | } 21 | -------------------------------------------------------------------------------- /examples/fly.io/README.md: -------------------------------------------------------------------------------- 1 | Login: 2 | 3 | ``` 4 | flyctl auth login 5 | ``` 6 | 7 | Create an app: 8 | 9 | ``` 10 | flyctl apps create simple-python-app 11 | ``` 12 | 13 | Allocate ipv4: 14 | 15 | ``` 16 | flyctl ips allocate-v4 17 | ``` 18 | 19 | Copy the container to fly.io registry: 20 | 21 | ``` 22 | devenv container processes --copy 23 | ``` 24 | 25 | Create a volume for `devenv` state: 26 | 27 | ``` 28 | fly volumes create devenv_state --region ams --size 1 29 | ``` 30 | 31 | Deploy your app: 32 | 33 | ``` 34 | flyctl deploy 35 | ``` -------------------------------------------------------------------------------- /docs/overrides/partials/copyright.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /src/modules/languages/pascal.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.pascal; 5 | in 6 | { 7 | options.languages.pascal = { 8 | enable = lib.mkEnableOption "tools for Pascal development"; 9 | 10 | lazarus = { 11 | enable = lib.mkEnableOption "lazarus graphical IDE for the FreePascal language"; 12 | }; 13 | }; 14 | 15 | config = lib.mkIf cfg.enable { 16 | packages = with pkgs; [ 17 | fpc 18 | ] ++ lib.optional (cfg.lazarus.enable && pkgs.stdenv.isLinux) pkgs.lazarus; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /src/modules/languages/r.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.r; 5 | in 6 | { 7 | options.languages.r = { 8 | enable = lib.mkEnableOption "tools for R development"; 9 | package = lib.mkOption { 10 | type = lib.types.package; 11 | default = pkgs.R; 12 | defaultText = lib.literalExpression "pkgs.R"; 13 | description = "The R package to use."; 14 | }; 15 | }; 16 | 17 | config = lib.mkIf cfg.enable { 18 | packages = with pkgs; [ 19 | cfg.package 20 | ]; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /tests/mysql/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | { 3 | services.mysql = { 4 | enable = true; 5 | initialDatabases = [{ name = "db"; }]; 6 | ensureUsers = [{ 7 | name = "db"; 8 | password = "db"; 9 | ensurePermissions = { "*.*" = "ALL PRIVILEGES"; }; 10 | }]; 11 | settings = { 12 | mysql = { 13 | host = "127.0.0.1"; 14 | user = "db"; 15 | password = "db"; 16 | }; 17 | }; 18 | }; 19 | 20 | scripts.ping-mysql.exec = '' 21 | $DEVENV_PROFILE/bin/mysqladmin ping 22 | ''; 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/languages/v.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.v; 5 | in 6 | { 7 | options.languages.v = { 8 | enable = lib.mkEnableOption "tools for V development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.vlang; 13 | defaultText = lib.literalExpression "pkgs.vlang"; 14 | description = "The V package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/languages/cue.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.cue; 5 | in 6 | { 7 | options.languages.cue = { 8 | enable = lib.mkEnableOption "tools for Cue development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.cue; 13 | defaultText = lib.literalExpression "pkgs.cue"; 14 | description = "The CUE package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/languages/dart.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.dart; 5 | in 6 | { 7 | options.languages.dart = { 8 | enable = lib.mkEnableOption "tools for Dart development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.dart; 13 | defaultText = lib.literalExpression "pkgs.dart"; 14 | description = "The Dart package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/languages/lean4.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let cfg = config.languages.lean4; 4 | in { 5 | options.languages.lean4 = { 6 | enable = lib.mkEnableOption "tools for lean4 development"; 7 | 8 | package = lib.mkOption { 9 | type = lib.types.package; 10 | default = pkgs.lean4; 11 | defaultText = "pkgs.lean4"; 12 | description = '' 13 | The lean4 package to use. 14 | ''; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /xtask/src/manpage.rs: -------------------------------------------------------------------------------- 1 | use super::cli::Cli; 2 | use clap::CommandFactory; 3 | use miette::{IntoDiagnostic, Result}; 4 | use std::fs; 5 | use std::path::{Path, PathBuf}; 6 | 7 | pub fn generate(out_dir: impl AsRef) -> Result<()> { 8 | fs::create_dir_all(&out_dir).into_diagnostic()?; 9 | clap_mangen::generate_to(Cli::command(), &out_dir).into_diagnostic()?; 10 | eprintln!("Generated man pages to {}", out_dir.as_ref().display()); 11 | Ok(()) 12 | } 13 | 14 | pub fn default_out_dir() -> PathBuf { 15 | std::env::current_dir().unwrap().join("man") 16 | } 17 | -------------------------------------------------------------------------------- /src/modules/languages/julia.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.julia; 5 | in 6 | { 7 | options.languages.julia = { 8 | enable = lib.mkEnableOption "tools for Julia development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.julia-bin; 13 | defaultText = lib.literalExpression "pkgs.julia-bin"; 14 | description = "The Julia package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/languages/nim.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.nim; 5 | in 6 | { 7 | options.languages.nim = { 8 | enable = lib.mkEnableOption "tools for Nim development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.nim; 13 | defaultText = lib.literalExpression "pkgs.nim"; 14 | description = "The Nim package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | pkgs.nimlsp 22 | ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /src/modules/languages/zig.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.zig; 5 | in 6 | { 7 | options.languages.zig = { 8 | enable = lib.mkEnableOption "tools for Zig development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | description = "Which package of Zig to use."; 13 | default = pkgs.zig; 14 | defaultText = lib.literalExpression "pkgs.zig"; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | pkgs.zls 22 | ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /src/modules/languages/lua.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.lua; 5 | in 6 | { 7 | options.languages.lua = { 8 | enable = lib.mkEnableOption "tools for Lua development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.lua; 13 | defaultText = lib.literalExpression "pkgs.lua"; 14 | description = "The Lua package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | pkgs.lua-language-server 22 | ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /src/modules/languages/racket.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.racket; 5 | in 6 | { 7 | options.languages.racket = { 8 | enable = lib.mkEnableOption "tools for Racket development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.racket-minimal; 13 | defaultText = lib.literalExpression "pkgs.racket-minimal"; 14 | description = "The Racket package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/languages/unison.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.unison; 5 | in 6 | { 7 | options.languages.unison = { 8 | enable = lib.mkEnableOption "tools for Unison development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | description = "Which package of Unison to use"; 13 | default = pkgs.unison-ucm; 14 | defaultText = lib.literalExpression "pkgs.unison-ucm"; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = [ 20 | cfg.package 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/modules/languages/opentofu.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.opentofu; 5 | in 6 | { 7 | options.languages.opentofu = { 8 | enable = lib.mkEnableOption "tools for OpenTofu development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.opentofu; 13 | defaultText = lib.literalExpression "pkgs.opentofu"; 14 | description = "The OpenTofu package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = with pkgs; [ 20 | cfg.package 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /examples/rubyonrails/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | # Create a new Rails project: 4 | # 5 | # gem install rails 6 | # rails new blog --database=postgresql --force 7 | # cd blog 8 | # bundle 9 | { 10 | languages.ruby.enable = true; 11 | languages.ruby.version = "3.2.2"; 12 | 13 | packages = [ 14 | pkgs.openssl 15 | pkgs.libyaml 16 | pkgs.git 17 | pkgs.curl 18 | pkgs.redis 19 | ]; 20 | 21 | services.postgres.enable = true; 22 | 23 | processes.rails.exec = "cd blog && rails server"; 24 | 25 | enterShell = '' 26 | export PATH="$DEVENV_ROOT/blog/bin:$PATH" 27 | ''; 28 | } 29 | -------------------------------------------------------------------------------- /src/modules/languages/idris.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let cfg = config.languages.idris; 4 | in { 5 | options.languages.idris = { 6 | enable = lib.mkEnableOption "tools for Idris development"; 7 | 8 | package = lib.mkOption { 9 | type = lib.types.package; 10 | default = pkgs.idris2; 11 | defaultText = "pkgs.idris2"; 12 | description = '' 13 | The Idris package to use. 14 | ''; 15 | example = "pkgs.idris"; 16 | }; 17 | }; 18 | 19 | config = lib.mkIf cfg.enable { 20 | packages = with pkgs; [ 21 | cfg.package 22 | ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /src/modules/languages/gleam.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.gleam; 5 | in 6 | { 7 | options.languages.gleam = { 8 | enable = lib.mkEnableOption "tools for Gleam development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.gleam; 13 | description = "The Gleam package to use."; 14 | defaultText = lib.literalExpression "pkgs.gleam"; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | languages.erlang.enable = true; 20 | 21 | packages = [ 22 | cfg.package 23 | ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /docs/supported-languages/r.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.r\.enable 7 | 8 | Whether to enable tools for R development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.r\.package 28 | 29 | 30 | 31 | The R package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.R ` 42 | -------------------------------------------------------------------------------- /examples/fly.io/devenv.nix: -------------------------------------------------------------------------------- 1 | { config, pkgs, lib, ... }: 2 | 3 | let 4 | pythonPackages = config.languages.python.package.pkgs; 5 | in 6 | { 7 | languages.python.enable = true; 8 | 9 | packages = [ pythonPackages.flask ] 10 | ++ lib.optionals (!config.container.isBuilding) [ pkgs.flyctl ]; 11 | 12 | processes.serve.exec = "flask --app hello run"; 13 | 14 | containers.processes.name = "simple-python-app"; 15 | containers.processes.registry = "docker://registry.fly.io/"; 16 | containers.processes.defaultCopyArgs = [ 17 | "--dest-creds" 18 | "x:\"$(${pkgs.flyctl}/bin/flyctl auth token)\"" 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /docs/supported-languages/go.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.go\.enable 7 | 8 | Whether to enable tools for Go development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.go\.package 28 | 29 | 30 | 31 | The Go package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.go ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/v.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.v\.enable 7 | 8 | Whether to enable tools for V development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.v\.package 28 | 29 | 30 | 31 | The V package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.vlang ` 42 | -------------------------------------------------------------------------------- /src/modules/languages/ansible.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.ansible; 5 | in 6 | { 7 | options.languages.ansible = { 8 | enable = lib.mkEnableOption "tools for Ansible development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.ansible; 13 | defaultText = lib.literalExpression "pkgs.ansible"; 14 | description = "The Ansible package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = with pkgs; [ 20 | ansible-lint 21 | cfg.package 22 | ]; 23 | }; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/modules/languages/vala.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.vala; 5 | in 6 | { 7 | options.languages.vala = { 8 | enable = lib.mkEnableOption "tools for Vala development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.vala; 13 | defaultText = lib.literalExpression "pkgs.vala"; 14 | description = "The Vala package to use."; 15 | example = lib.literalExpression "pkgs.vala_0_54"; 16 | }; 17 | }; 18 | 19 | config = lib.mkIf cfg.enable { 20 | packages = [ 21 | cfg.package 22 | ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /docs/supported-languages/cue.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.cue\.enable 7 | 8 | Whether to enable tools for Cue development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.cue\.package 28 | 29 | 30 | 31 | The CUE package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.cue ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/lua.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.lua\.enable 7 | 8 | Whether to enable tools for Lua development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.lua\.package 28 | 29 | 30 | 31 | The Lua package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.lua ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/nim.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.nim\.enable 7 | 8 | Whether to enable tools for Nim development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.nim\.package 28 | 29 | 30 | 31 | The Nim package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.nim ` 42 | -------------------------------------------------------------------------------- /src/modules/languages/elixir.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.elixir; 5 | in 6 | { 7 | options.languages.elixir = { 8 | enable = lib.mkEnableOption "tools for Elixir development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | description = "Which package of Elixir to use."; 13 | default = pkgs.elixir; 14 | defaultText = lib.literalExpression "pkgs.elixir"; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable 19 | { 20 | packages = with pkgs; [ 21 | cfg.package 22 | elixir_ls 23 | ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /src/modules/languages/fortran.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.fortran; 5 | in 6 | { 7 | options.languages.fortran = { 8 | enable = lib.mkEnableOption "tools for Fortran Development."; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.gfortran; 13 | defaultText = lib.literalExpression "pkgs.gfortran"; 14 | description = "The Fortran package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = with pkgs; [ 20 | fortran-fpm 21 | fortran-language-server 22 | ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /docs/supported-languages/nix.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.nix\.enable 7 | 8 | Whether to enable tools for Nix development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.nix\.lsp\.package 28 | 29 | 30 | 31 | The LSP package to use 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.nil ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/zig.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.zig\.enable 7 | 8 | Whether to enable tools for Zig development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.zig\.package 28 | 29 | 30 | 31 | Which package of Zig to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.zig ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/dart.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.dart\.enable 7 | 8 | Whether to enable tools for Dart development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.dart\.package 28 | 29 | 30 | 31 | The Dart package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.dart ` 42 | -------------------------------------------------------------------------------- /templates/flake-parts/.envrc: -------------------------------------------------------------------------------- 1 | if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then 2 | source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" 3 | fi 4 | 5 | nix_direnv_watch_file flake.nix 6 | nix_direnv_watch_file flake.lock 7 | 8 | DEVENV_ROOT_FILE="$(mktemp)" 9 | printf %s "$PWD" > "$DEVENV_ROOT_FILE" 10 | if ! use flake . --override-input devenv-root "file+file://$DEVENV_ROOT_FILE" 11 | then 12 | echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 13 | fi 14 | -------------------------------------------------------------------------------- /docs/supported-languages/deno.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.deno\.enable 7 | 8 | Whether to enable tools for Deno development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.deno\.package 28 | 29 | 30 | 31 | Which package of Deno to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.deno ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/gleam.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.gleam\.enable 7 | 8 | Whether to enable tools for Gleam development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.gleam\.package 28 | 29 | 30 | 31 | The Gleam package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.gleam ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/lean4.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.lean4\.enable 7 | 8 | Whether to enable tools for lean4 development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.lean4\.package 28 | 29 | 30 | 31 | The lean4 package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` "pkgs.lean4" ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/swift.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.swift\.enable 7 | 8 | Whether to enable tools for Swift development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.swift\.package 28 | 29 | 30 | 31 | The Swift package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` "pkgs.swift" ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/julia.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.julia\.enable 7 | 8 | Whether to enable tools for Julia development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.julia\.package 28 | 29 | 30 | 31 | The Julia package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.julia-bin ` 42 | -------------------------------------------------------------------------------- /src/modules/languages/erlang.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.erlang; 5 | in 6 | { 7 | options.languages.erlang = { 8 | enable = lib.mkEnableOption "tools for Erlang development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | description = "Which package of Erlang to use."; 13 | default = pkgs.erlang; 14 | defaultText = lib.literalExpression "pkgs.erlang"; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable 19 | { 20 | packages = [ 21 | cfg.package 22 | pkgs.erlang-ls 23 | pkgs.rebar3 24 | ]; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /src/modules/languages/standardml.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.standardml; 5 | in 6 | { 7 | options.languages.standardml = { 8 | enable = lib.mkEnableOption "tools for Standard ML development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.mlton; 13 | defaultText = "pkgs.mlton"; 14 | description = '' 15 | The Standard ML package to use. 16 | ''; 17 | }; 18 | }; 19 | 20 | config = lib.mkIf cfg.enable { 21 | packages = with pkgs; [ 22 | cfg.package 23 | millet 24 | smlfmt 25 | ]; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /docs/supported-languages/ansible.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.ansible\.enable 7 | 8 | Whether to enable tools for Ansible development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.ansible\.package 28 | 29 | 30 | 31 | The Ansible package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.ansible ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/dotnet.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.dotnet\.enable 7 | 8 | Whether to enable tools for \.NET development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.dotnet\.package 28 | 29 | 30 | 31 | The \.NET SDK package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.dotnet-sdk ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/elixir.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.elixir\.enable 7 | 8 | Whether to enable tools for Elixir development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.elixir\.package 28 | 29 | 30 | 31 | Which package of Elixir to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.elixir ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/erlang.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.erlang\.enable 7 | 8 | Whether to enable tools for Erlang development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.erlang\.package 28 | 29 | 30 | 31 | Which package of Erlang to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.erlang ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/fortran.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.fortran\.enable 7 | 8 | Whether to enable tools for Fortran Development… 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.fortran\.package 28 | 29 | 30 | 31 | The Fortran package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.gfortran ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/unison.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.unison\.enable 7 | 8 | Whether to enable tools for Unison development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.unison\.package 28 | 29 | 30 | 31 | Which package of Unison to use 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.unison-ucm ` 42 | -------------------------------------------------------------------------------- /examples/racket/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | packages = with pkgs; [ 5 | bash-completion 6 | ]; 7 | 8 | languages = { 9 | racket = { 10 | enable = true; 11 | # Use package with bundled packages (Racket Full distribution ) 12 | # Shell completion files are only available in Racket Full distribution 13 | package = pkgs.racket; 14 | }; 15 | }; 16 | 17 | enterShell = '' 18 | # Check if everything works as expected 19 | racket --version 20 | # Enable bash completion in devenv shell for `raco` 21 | source ${pkgs.racket}/share/racket/pkgs/shell-completion/racket-completion.bash 22 | ''; 23 | } 24 | -------------------------------------------------------------------------------- /docs/supported-languages/opentofu.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.opentofu\.enable 7 | 8 | Whether to enable tools for OpenTofu development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.opentofu\.package 28 | 29 | 30 | 31 | The OpenTofu package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.opentofu ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/racket.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.racket\.enable 7 | 8 | Whether to enable tools for Racket development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.racket\.package 28 | 29 | 30 | 31 | The Racket package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.racket-minimal ` 42 | -------------------------------------------------------------------------------- /src/modules/languages/swift.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.swift; 5 | in 6 | { 7 | options.languages.swift = { 8 | enable = lib.mkEnableOption "tools for Swift development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.swift; 13 | defaultText = "pkgs.swift"; 14 | description = '' 15 | The Swift package to use. 16 | ''; 17 | }; 18 | }; 19 | 20 | config = lib.mkIf cfg.enable { 21 | packages = with pkgs; [ 22 | cfg.package 23 | pkgs.clang 24 | ]; 25 | 26 | env.CC = "${pkgs.clang}/bin/clang"; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /examples/starship/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | starship.enable = true; 5 | 6 | # You can change `enableConfig` to true to override Starship default values. 7 | # By default, it looks for a configuration file next to your `devenv.yaml`. 8 | #starship.config.enable = true; 9 | # If you don't want to place your configuration file next to your `devenv.yaml`, 10 | # change `config.path` to point to the Starship configuration file you want to use. 11 | #starship.config.path = ~/.config/custom_starship.toml; 12 | 13 | # With `enableConfig` set to `false`, Starship will still look for a configuration 14 | # file in '~/.config/starship.toml'. 15 | } 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve devenv 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To reproduce** 14 | Please provide an [Short, Self Contained, Correct (Compilable), Example](http://sscce.org) by [creating a gist](https://gist.github.com/) using `devenv.nix`, `devenv.yaml`, and optionally `devenv.lock`. 15 | 16 | Make sure to include full logs and what you expected to happen. 17 | 18 | **Version** 19 | 20 | Paste the output of `$ devenv version` here or tell us if you're using flakes. 21 | -------------------------------------------------------------------------------- /docs/supported-process-managers/honcho.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## process-managers\.honcho\.enable 7 | 8 | Whether to enable honcho as process-manager\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## process-managers\.honcho\.package 28 | 29 | 30 | 31 | The honcho package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.honcho ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/purescript.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.purescript\.enable 7 | 8 | Whether to enable tools for PureScript development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.purescript\.package 28 | 29 | 30 | 31 | The PureScript package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.purescript ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/standardml.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.standardml\.enable 7 | 8 | Whether to enable tools for Standard ML development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.standardml\.package 28 | 29 | 30 | 31 | The Standard ML package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` "pkgs.mlton" ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/ocaml.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.ocaml\.enable 7 | 8 | Whether to enable tools for OCaml development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.ocaml\.packages 28 | 29 | 30 | 31 | The package set of OCaml to use 32 | 33 | 34 | 35 | *Type:* 36 | attribute set 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.ocaml-ng.ocamlPackages_4_12 ` 42 | -------------------------------------------------------------------------------- /docs/supported-process-managers/hivemind.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## process-managers\.hivemind\.enable 7 | 8 | Whether to enable hivemind as process-manager\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## process-managers\.hivemind\.package 28 | 29 | 30 | 31 | The hivemind package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.hivemind ` 42 | -------------------------------------------------------------------------------- /docs/supported-process-managers/overmind.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## process-managers\.overmind\.enable 7 | 8 | Whether to enable overmind as process-manager\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## process-managers\.overmind\.package 28 | 29 | 30 | 31 | The overmind package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.overmind ` 42 | -------------------------------------------------------------------------------- /src/modules/languages/robotframework.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.robotframework; 5 | in 6 | { 7 | options.languages.robotframework = { 8 | enable = lib.mkEnableOption "tools for Robot Framework development"; 9 | 10 | python = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.python3; 13 | defaultText = lib.literalExpression "pkgs.python3"; 14 | description = "The Python package to use."; 15 | }; 16 | 17 | }; 18 | 19 | config = lib.mkIf cfg.enable { 20 | packages = [ 21 | (cfg.python.withPackages (ps: [ 22 | ps.robotframework 23 | ])) 24 | ]; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /docs/supported-languages/robotframework.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.robotframework\.enable 7 | 8 | Whether to enable tools for Robot Framework development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.robotframework\.python 28 | 29 | 30 | 31 | The Python package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.python3 ` 42 | -------------------------------------------------------------------------------- /docs/supported-languages/vala.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.vala\.enable 7 | 8 | Whether to enable tools for Vala development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.vala\.package 28 | 29 | 30 | 31 | The Vala package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.vala ` 42 | 43 | 44 | 45 | *Example:* 46 | ` pkgs.vala_0_54 ` 47 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: "Publish a flake to flakestry" 2 | on: 3 | push: 4 | tags: 5 | - "v?[0-9]+.[0-9]+.[0-9]+" 6 | - "v?[0-9]+.[0-9]+" 7 | workflow_dispatch: 8 | inputs: 9 | tag: 10 | description: "The existing tag to publish" 11 | type: "string" 12 | required: true 13 | jobs: 14 | publish-flake: 15 | runs-on: ubuntu-latest 16 | permissions: 17 | id-token: "write" 18 | contents: "read" 19 | steps: 20 | - uses: flakestry/flakestry-publish@main 21 | with: 22 | version: "${{ inputs.tag || github.ref_name }}" 23 | -------------------------------------------------------------------------------- /examples/simple/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | # https://devenv.sh/basics/ 5 | env.GREET = "devenv"; 6 | 7 | # https://devenv.sh/packages/ 8 | packages = [ pkgs.git ]; 9 | 10 | # https://devenv.sh/scripts/ 11 | scripts.hello.exec = "echo hello from $GREET"; 12 | 13 | enterShell = '' 14 | hello 15 | git --version 16 | ''; 17 | 18 | # https://devenv.sh/languages/ 19 | # languages.nix.enable = true; 20 | 21 | # https://devenv.sh/pre-commit-hooks/ 22 | # pre-commit.hooks.shellcheck.enable = true; 23 | 24 | # https://devenv.sh/processes/ 25 | # processes.ping.exec = "ping localhost"; 26 | 27 | # See full reference at https://devenv.sh/reference/options/ 28 | } 29 | -------------------------------------------------------------------------------- /src/modules/languages/perl.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.perl; 5 | in 6 | { 7 | options.languages.perl = { 8 | enable = lib.mkEnableOption "tools for Perl development"; 9 | packages = lib.mkOption 10 | { 11 | type = lib.types.listOf lib.types.str; 12 | description = "Perl packages to include"; 13 | default = [ ]; 14 | example = [ "Mojolicious" ]; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = with pkgs; [ 20 | (perl.withPackages (p: (with builtins; map 21 | (pkg: p.${ replaceStrings [ "::" ] [ "" ] pkg }) 22 | cfg.packages))) 23 | ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /docs/supported-languages/idris.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.idris\.enable 7 | 8 | Whether to enable tools for Idris development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.idris\.package 28 | 29 | 30 | 31 | The Idris package to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` "pkgs.idris2" ` 42 | 43 | 44 | 45 | *Example:* 46 | ` "pkgs.idris" ` 47 | -------------------------------------------------------------------------------- /docs/garbage-collection.md: -------------------------------------------------------------------------------- 1 | # Garbage collection 2 | 3 | `devenv` involves optimizing disk space utilization through the creation of garbage collection roots for each activated developer environment, which is especially beneficial when switching between branches. 4 | 5 | This is based on the premise that disk space is inexpensive and can be better utilized by creating a root for each environment. The garbage collection process can be initiated by running the command `devenv gc` when it is deemed necessary to free up space. 6 | 7 | Running ``devenv gc`` will go through everything you've built so far 8 | and delete anything that's currently not the latest successful invocation 9 | of any ``devenv`` command per folder. 10 | -------------------------------------------------------------------------------- /src/modules/process-managers/hivemind.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | let 3 | cfg = config.process-managers.hivemind; 4 | in 5 | { 6 | options.process-managers.hivemind = { 7 | enable = lib.mkEnableOption "hivemind as process-manager"; 8 | package = lib.mkOption { 9 | type = lib.types.package; 10 | default = pkgs.hivemind; 11 | defaultText = lib.literalExpression "pkgs.hivemind"; 12 | description = "The hivemind package to use."; 13 | }; 14 | }; 15 | config = lib.mkIf cfg.enable { 16 | processManagerCommand = '' 17 | ${cfg.package}/bin/hivemind --print-timestamps "$@" ${config.procfile} & 18 | ''; 19 | 20 | packages = [ cfg.package ]; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /src/modules/process-managers/honcho.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | let 3 | cfg = config.process-managers.honcho; 4 | in 5 | { 6 | options.process-managers.honcho = { 7 | enable = lib.mkEnableOption "honcho as process-manager"; 8 | package = lib.mkOption { 9 | type = lib.types.package; 10 | default = pkgs.honcho; 11 | defaultText = lib.literalExpression "pkgs.honcho"; 12 | description = "The honcho package to use."; 13 | }; 14 | }; 15 | config = lib.mkIf cfg.enable { 16 | processManagerCommand = '' 17 | ${cfg.package}/bin/honcho start -f ${config.procfile} --env ${config.procfileEnv} "$@" & 18 | ''; 19 | 20 | packages = [ cfg.package ]; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /docs/supported-languages/c.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.c\.enable 7 | 8 | 9 | 10 | Whether to enable tools for C development\. 11 | 12 | 13 | 14 | *Type:* 15 | boolean 16 | 17 | 18 | 19 | *Default:* 20 | ` false ` 21 | 22 | 23 | 24 | *Example:* 25 | ` true ` 26 | 27 | 28 | 29 | ## languages\.c\.debugger 30 | 31 | An optional debugger package to use with c\. 32 | The default is ` gdb `, if supported on the current system\. 33 | 34 | 35 | 36 | *Type:* 37 | null or package 38 | 39 | 40 | 41 | *Default:* 42 | ` pkgs.gdb ` 43 | -------------------------------------------------------------------------------- /docs/supported-languages/perl.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.perl\.enable 7 | 8 | Whether to enable tools for Perl development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.perl\.packages 28 | 29 | 30 | 31 | Perl packages to include 32 | 33 | 34 | 35 | *Type:* 36 | list of string 37 | 38 | 39 | 40 | *Default:* 41 | ` [ ] ` 42 | 43 | 44 | 45 | *Example:* 46 | 47 | ``` 48 | [ 49 | "Mojolicious" 50 | ] 51 | ``` 52 | -------------------------------------------------------------------------------- /examples/caddy-php/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | 3 | { 4 | languages.php = { 5 | enable = true; 6 | version = "8.1"; 7 | ini = '' 8 | memory_limit = 256M 9 | ''; 10 | fpm.pools.web = { 11 | settings = { 12 | "pm" = "dynamic"; 13 | "pm.max_children" = 5; 14 | "pm.start_servers" = 2; 15 | "pm.min_spare_servers" = 1; 16 | "pm.max_spare_servers" = 5; 17 | }; 18 | }; 19 | }; 20 | 21 | services.caddy.enable = true; 22 | services.caddy.virtualHosts."http://localhost:8000" = { 23 | extraConfig = '' 24 | root * public 25 | php_fastcgi unix/${config.languages.php.fpm.pools.web.socket} 26 | file_server 27 | ''; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /src/modules/info.nix: -------------------------------------------------------------------------------- 1 | { lib, config, ... }: 2 | 3 | let 4 | renderSection = section: lib.concatStringsSep "\n" (builtins.map (entry: "- ${entry}") section); 5 | in 6 | { 7 | options = { 8 | info = lib.mkOption { 9 | type = lib.types.lines; 10 | internal = true; 11 | }; 12 | 13 | infoSections = lib.mkOption { 14 | type = lib.types.attrsOf (lib.types.listOf lib.types.str); 15 | default = { }; 16 | description = 17 | "Information about the environment"; 18 | }; 19 | }; 20 | 21 | 22 | config = { 23 | info = lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: section: if (section != [ ]) then "# ${name}\n${renderSection section}" else "") config.infoSections); 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /docs/supported-languages/pascal.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.pascal\.enable 7 | 8 | Whether to enable tools for Pascal development\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## languages\.pascal\.lazarus\.enable 28 | 29 | 30 | 31 | Whether to enable lazarus graphical IDE for the FreePascal language\. 32 | 33 | 34 | 35 | *Type:* 36 | boolean 37 | 38 | 39 | 40 | *Default:* 41 | ` false ` 42 | 43 | 44 | 45 | *Example:* 46 | ` true ` 47 | -------------------------------------------------------------------------------- /docs/integrations/dotenv.md: -------------------------------------------------------------------------------- 1 | [.env](https://github.com/motdotla/dotenv) files were introduced by Heroku in 2012. 2 | 3 | If you have a `.env`, you'll see instructions how to enable integration: 4 | 5 | ```nix title="devenv.nix" 6 | { 7 | dotenv.enable = true; 8 | 9 | # Optionally, you can choose which filename to load. 10 | # 11 | # dotenv.filename = ".env.production"; 12 | # or 13 | # dotenv.filename = [ ".env.production" ".env.development" ] 14 | } 15 | ``` 16 | 17 | When the developer environment is loaded, environment variables from `.env` will be loaded 18 | and set into `config.env`. 19 | 20 | Variables from `.env` are set using `lib.mkDefault`, meaning that any existing `env` variables set in `devenv.nix` will have priority over them. 21 | -------------------------------------------------------------------------------- /examples/vala/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, ... }: 2 | 3 | { 4 | packages = with pkgs; [ 5 | # Check Vala code files for code-style errors 6 | # vala-lint 7 | ]; 8 | 9 | languages = { 10 | vala = { 11 | enable = pkgs.stdenv.isLinux; 12 | # This is the default package for Vala for the configured channel (see nixpkgs input in devenv.yaml) 13 | # It can be configured to use a specific version 14 | # Take a look [here](https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=vala) to find out which versions are available 15 | package = pkgs.vala; 16 | }; 17 | }; 18 | 19 | enterShell = '' 20 | echo "This development environment uses $(vala --version)." 21 | ''; 22 | } 23 | -------------------------------------------------------------------------------- /src/modules/languages/dotnet.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.dotnet; 5 | in 6 | { 7 | options.languages.dotnet = { 8 | enable = lib.mkEnableOption "tools for .NET development"; 9 | 10 | package = lib.mkOption { 11 | type = lib.types.package; 12 | default = pkgs.dotnetCorePackages.sdk_7_0; 13 | defaultText = lib.literalExpression "pkgs.dotnet-sdk"; 14 | description = "The .NET SDK package to use."; 15 | }; 16 | }; 17 | 18 | config = lib.mkIf cfg.enable { 19 | packages = with pkgs; [ 20 | cfg.package 21 | ]; 22 | 23 | env.DOTNET_ROOT = "${cfg.package}"; 24 | env.LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${lib.makeLibraryPath [ pkgs.icu ]}"; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /examples/python-poetry/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | { 4 | packages = [ 5 | # A python dependency outside of poetry. 6 | config.languages.python.package.pkgs.pjsua2 7 | ]; 8 | 9 | languages.python = { 10 | enable = true; 11 | poetry = { 12 | enable = true; 13 | install = { 14 | enable = true; 15 | installRootPackage = false; 16 | onlyInstallRootPackage = false; 17 | compile = false; 18 | quiet = false; 19 | groups = [ ]; 20 | ignoredGroups = [ ]; 21 | onlyGroups = [ ]; 22 | extras = [ ]; 23 | allExtras = false; 24 | verbosity = "no"; 25 | }; 26 | activate.enable = true; 27 | package = pkgs.poetry; 28 | }; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /docs/assets/extra.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | body { 6 | /* Override the mkdocs default of 0.5rem */ 7 | font-size: 0.8rem; /* 16px */ 8 | } 9 | 10 | /* hide site name */ 11 | .md-header__topic { 12 | visibility: hidden; 13 | } 14 | /* mobile hide site name */ 15 | .md-nav__title { 16 | font-size: 0!important; 17 | } 18 | 19 | /* mobile make code snippets scrollable */ 20 | .image-wrapper { 21 | overflow: auto!important; 22 | } 23 | 24 | /* add some whitespace under hero CTA button */ 25 | .md-main__inner { 26 | padding-bottom: 1rem; 27 | } 28 | 29 | @layer components { 30 | .language-shell::before { 31 | content: attr(data-shell-prefix); 32 | @apply me-2 text-blue-300; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /examples/vault/.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | # vault status and store its exit status 5 | check_vault_status() { 6 | echo "Waiting for service to become available..." 7 | VAULT_OUTPUT=$(vault status 2>&1) 8 | VAULT_EXIT_STATUS=$? 9 | } 10 | 11 | # Continuously check vault status until it returns successfully (up to a maximum of 100 times) 12 | # shellcheck disable=SC2034 13 | for i in $(seq 1 20); do 14 | check_vault_status 15 | if [ $VAULT_EXIT_STATUS -eq 0 ]; then 16 | echo "Service is up..." 17 | break 18 | else 19 | sleep 1 20 | fi 21 | done 22 | 23 | # Print the captured output when vault status succeeds 24 | echo "Startup complete..." 25 | vault version 26 | echo "$VAULT_OUTPUT" 27 | 28 | # Exit the script 29 | exit "$VAULT_EXIT_STATUS" 30 | -------------------------------------------------------------------------------- /examples/phoenix/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | # Install Phoenix dependencies: 4 | 5 | # mix local.hex 6 | # mix local.rebar 7 | # mix archive.install hex phx_new 8 | # 9 | # Follow the instructions from https://hexdocs.pm/phoenix/up_and_running.html 10 | # Run `mix phx.new hello --install` to create a new Phoenix project 11 | { 12 | packages = [ 13 | pkgs.git 14 | ] ++ lib.optionals pkgs.stdenv.isLinux [ pkgs.inotify-tools ]; 15 | 16 | languages.elixir.enable = true; 17 | 18 | services.postgres = { 19 | enable = true; 20 | initialScript = '' 21 | CREATE ROLE postgres WITH LOGIN PASSWORD 'postgres' SUPERUSER; 22 | ''; 23 | initialDatabases = [{ name = "hello_dev"; }]; 24 | }; 25 | 26 | processes.phoenix.exec = "cd hello && mix phx.server"; 27 | } 28 | -------------------------------------------------------------------------------- /docs/assets/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/modules/languages/deno.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.deno; 5 | in 6 | { 7 | options.languages.deno = { 8 | enable = lib.mkEnableOption "tools for Deno development"; 9 | package = lib.mkOption { 10 | type = lib.types.package; 11 | description = "Which package of Deno to use."; 12 | default = pkgs.deno; 13 | defaultText = lib.literalExpression "pkgs.deno"; 14 | }; 15 | }; 16 | 17 | config = lib.mkIf cfg.enable { 18 | packages = [ 19 | cfg.package 20 | ]; 21 | 22 | env.DENO_INSTALL_ROOT = config.env.DEVENV_STATE + "/deno"; 23 | env.DENO_DIR = config.env.DENO_INSTALL_ROOT + "/cache"; 24 | 25 | enterShell = '' 26 | export PATH="$PATH:$DENO_INSTALL_ROOT/bin" 27 | ''; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /xtask/src/shell_completion.rs: -------------------------------------------------------------------------------- 1 | use crate::cli::Cli; 2 | use clap::CommandFactory; 3 | use miette::{IntoDiagnostic, Result}; 4 | use std::fs; 5 | use std::path::{Path, PathBuf}; 6 | 7 | pub fn generate(shell: clap_complete::Shell, out_dir: impl AsRef) -> Result<()> { 8 | fs::create_dir_all(&out_dir).into_diagnostic()?; 9 | let mut cmd = Cli::command(); 10 | let bin_name = cmd.get_name().to_string(); 11 | let completion_path = clap_complete::generate_to(shell, &mut cmd, bin_name, out_dir.as_ref()) 12 | .into_diagnostic()?; 13 | eprintln!( 14 | "Generated {} completions to {}", 15 | shell, 16 | completion_path.display() 17 | ); 18 | Ok(()) 19 | } 20 | 21 | pub fn default_out_dir() -> PathBuf { 22 | std::env::current_dir().unwrap() 23 | } 24 | -------------------------------------------------------------------------------- /filterOptions.nix: -------------------------------------------------------------------------------- 1 | # https://gitlab.com/rycee/nur-expressions/-/blob/master/doc/default.nix 2 | # https://github.com/molybdenumsoftware/pr-tracker/blob/main/filterOptions.nix 3 | { concatMapAttrs 4 | , isOption 5 | , ... 6 | }: predicate: options: 7 | let 8 | inherit (builtins) isAttrs; 9 | 10 | recurse = path: options: 11 | concatMapAttrs 12 | ( 13 | name: value: 14 | let 15 | newPath = path ++ [ name ]; 16 | in 17 | if !(isAttrs value) 18 | then { ${name} = value; } 19 | else if !(isOption value) 20 | then { ${name} = recurse newPath value; } 21 | else if predicate newPath value 22 | then { ${name} = value; } 23 | else { } 24 | ) 25 | options; 26 | in 27 | recurse [ ] options 28 | -------------------------------------------------------------------------------- /src/modules/services/trafficserver/ip_allow.json: -------------------------------------------------------------------------------- 1 | { 2 | "ip_allow": [ 3 | { 4 | "apply": "in", 5 | "ip_addrs": "127.0.0.1", 6 | "action": "allow", 7 | "methods": "ALL" 8 | }, 9 | { 10 | "apply": "in", 11 | "ip_addrs": "::1", 12 | "action": "allow", 13 | "methods": "ALL" 14 | }, 15 | { 16 | "apply": "in", 17 | "ip_addrs": "0/0", 18 | "action": "deny", 19 | "methods": [ 20 | "PURGE", 21 | "PUSH", 22 | "DELETE", 23 | "TRACE" 24 | ] 25 | }, 26 | { 27 | "apply": "in", 28 | "ip_addrs": "::/0", 29 | "action": "deny", 30 | "methods": [ 31 | "PURGE", 32 | "PUSH", 33 | "DELETE", 34 | "TRACE" 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /examples/rust-wasm-cross/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | languages.rust = { 5 | enable = true; 6 | # https://devenv.sh/reference/options/#languagesrustchannel 7 | channel = "nightly"; 8 | 9 | targets = [ "wasm32-unknown-unknown" ]; 10 | 11 | components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" "rust-std" ]; 12 | }; 13 | 14 | pre-commit.hooks = { 15 | clippy = { 16 | enable = true; 17 | settings.offline = false; 18 | extraPackages = [ pkgs.openssl ]; 19 | }; 20 | rustfmt.enable = true; 21 | }; 22 | 23 | packages = [ 24 | pkgs.wasm-pack 25 | pkgs.binaryen # use a newer version of wasm-opt 26 | pkgs.nodejs 27 | ] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [ 28 | frameworks.Security 29 | ]); 30 | } 31 | -------------------------------------------------------------------------------- /examples/python-django/manage.py: -------------------------------------------------------------------------------- 1 | #!/nix/store/iw1vmh509hcbby8dbpsaanbri4zsq7dj-python3-3.10.10/bin/python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /examples/supported-languages/.patch.sh: -------------------------------------------------------------------------------- 1 | # arm is not supported yet 2 | echo "{ pkgs, lib, ... }: {" > devenv.local.nix 3 | echo " languages.unison.enable = lib.mkForce (!(pkgs.stdenv.isLinux && pkgs.stdenv.isAarch64));" >> devenv.local.nix 4 | echo " languages.standardml.enable = lib.mkForce (!pkgs.stdenv.isAarch64);" >> devenv.local.nix 5 | # https://github.com/NixOS/nixpkgs/issues/297019 6 | echo " languages.purescript.enable = lib.mkForce (!pkgs.stdenv.isAarch64);" >> devenv.local.nix 7 | echo " android.enable = lib.mkForce (pkgs.stdenv.isLinux && !pkgs.stdenv.isAarch64);" >> devenv.local.nix 8 | # Doesn't build on macOS. Check nixpkgs 9 | # Doesn't support arm. 10 | echo " languages.odin.enable = lib.mkForce (!(pkgs.stdenv.isDarwin || (pkgs.stdenv.isLinux && pkgs.stdenv.isAarch64)));" >> devenv.local.nix 11 | echo "}" >> devenv.local.nix 12 | -------------------------------------------------------------------------------- /src/modules/services/influxdb.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | let 4 | cfg = config.services.influxdb; 5 | types = lib.types; 6 | in 7 | { 8 | options.services.influxdb = { 9 | enable = lib.mkEnableOption "influxdb"; 10 | 11 | package = lib.mkOption { 12 | type = types.package; 13 | description = "An open-source distributed time series database"; 14 | default = pkgs.influxdb; 15 | defaultText = lib.literalExpression "pkgs.influxdb"; 16 | }; 17 | 18 | config = lib.mkOption { 19 | type = types.lines; 20 | default = ""; 21 | description = "Configuration for InfluxDB-server"; 22 | }; 23 | }; 24 | 25 | config = lib.mkIf cfg.enable { 26 | processes.influxdb-server.exec = "${cfg.package}/bin/influxd -config ${pkgs.writeText "influxdb.conf" cfg.config}"; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /docs/supported-services/adminer.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## services\.adminer\.enable 7 | 8 | Whether to enable Adminer process\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## services\.adminer\.package 28 | 29 | 30 | 31 | Which package of Adminer to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.adminer ` 42 | 43 | 44 | 45 | ## services\.adminer\.listen 46 | 47 | 48 | 49 | Listen address for the Adminer\. 50 | 51 | 52 | 53 | *Type:* 54 | string 55 | 56 | 57 | 58 | *Default:* 59 | ` "127.0.0.1:8080" ` 60 | -------------------------------------------------------------------------------- /src/modules/services/trafficserver/update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Fetch some of the default configuration files for Traffic Server 4 | 5 | set -euxo pipefail 6 | 7 | FILES=(ip_allow logging) 8 | 9 | yq() { 10 | nix run 'nixpkgs#yq' -- "$@" 11 | } 12 | 13 | copy() { 14 | local dir="$1" 15 | local files=("${@:2}") 16 | for f in "${files[@]}"; do 17 | yq . "$dir/$f.yaml" > "$f.json" 18 | chmod 644 -- "$f.json" 19 | done 20 | } 21 | 22 | main() { 23 | local -a outs 24 | while IFS= read -r line; do 25 | outs+=("$line") 26 | done < <(nix build --no-link --print-out-paths 'nixpkgs#trafficserver') 27 | 28 | local d out 29 | for out in "${outs[@]}"; do 30 | d="$out/etc/trafficserver" 31 | if [[ -d "$d" ]]; then 32 | copy "$d" "${FILES[@]}" 33 | break 34 | fi 35 | done 36 | } 37 | 38 | main "$@" 39 | -------------------------------------------------------------------------------- /examples/python-django/myproject/urls.py: -------------------------------------------------------------------------------- 1 | """myproject URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | ] 22 | -------------------------------------------------------------------------------- /src/modules/languages/texlive.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | let 3 | cfg = config.languages.texlive; 4 | 5 | base = cfg.base; 6 | packages = lib.genAttrs cfg.packages (name: base.${name} or (throw "No such texlive package ${name}")); 7 | package = base.combine packages; 8 | in 9 | { 10 | options.languages.texlive = { 11 | enable = lib.mkEnableOption "TeX Live"; 12 | base = lib.mkOption { 13 | default = pkgs.texlive; 14 | defaultText = lib.literalExpression "pkgs.texlive"; 15 | description = "TeX Live package set to use"; 16 | }; 17 | packages = lib.mkOption { 18 | type = lib.types.nonEmptyListOf lib.types.str; 19 | default = [ "collection-basic" ]; 20 | description = "Packages available to TeX Live"; 21 | }; 22 | }; 23 | config = lib.mkIf cfg.enable { 24 | packages = [ package ]; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /src/modules/process-managers/overmind.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | let 3 | cfg = config.process-managers.overmind; 4 | in 5 | { 6 | options.process-managers.overmind = { 7 | enable = lib.mkEnableOption "overmind as process-manager"; 8 | package = lib.mkOption { 9 | type = lib.types.package; 10 | default = pkgs.overmind; 11 | defaultText = lib.literalExpression "pkgs.overmind"; 12 | description = "The overmind package to use."; 13 | }; 14 | }; 15 | config = lib.mkIf cfg.enable { 16 | processManagerCommand = '' 17 | OVERMIND_ENV=${config.procfileEnv} ${cfg.package}/bin/overmind start \ 18 | --root ${config.env.DEVENV_ROOT} \ 19 | --socket ${config.devenv.runtime}/overmind.sock \ 20 | --procfile ${config.procfile} "$@" & 21 | ''; 22 | 23 | packages = [ cfg.package ]; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /docs/languages.md: -------------------------------------------------------------------------------- 1 | # Languages 2 | 3 | What if you could have the tooling for any programming language by flipping a toggle? 4 | 5 | ```nix title="devenv.nix" 6 | { pkgs, ... }: 7 | 8 | { 9 | languages.python.enable = true; 10 | languages.python.version = "3.11.3"; 11 | 12 | languages.rust.enable = true; 13 | # https://devenv.sh/reference/options/#languagesrustchannel 14 | languages.rust.channel = "stable"; 15 | } 16 | ``` 17 | 18 | ``devenv`` will provide executables for both languages: 19 | 20 | ```shell-session 21 | $ devenv shell 22 | Building shell ... 23 | Entering shell ... 24 | 25 | (devenv) $ python --version 26 | Python 3.11.3 27 | ``` 28 | 29 | ## Supported languages 30 | 31 | {% 32 | include-markdown "languages-all.md" 33 | %} 34 | 35 | You can find all supported options for languages [here](https://devenv.sh/reference/options/#languagesansibleenable). 36 | -------------------------------------------------------------------------------- /docs/supported-services/influxdb.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## services\.influxdb\.enable 7 | 8 | 9 | 10 | Whether to enable influxdb\. 11 | 12 | 13 | 14 | *Type:* 15 | boolean 16 | 17 | 18 | 19 | *Default:* 20 | ` false ` 21 | 22 | 23 | 24 | *Example:* 25 | ` true ` 26 | 27 | 28 | 29 | ## services\.influxdb\.package 30 | 31 | 32 | 33 | An open-source distributed time series database 34 | 35 | 36 | 37 | *Type:* 38 | package 39 | 40 | 41 | 42 | *Default:* 43 | ` pkgs.influxdb ` 44 | 45 | 46 | 47 | ## services\.influxdb\.config 48 | 49 | Configuration for InfluxDB-server 50 | 51 | 52 | 53 | *Type:* 54 | strings concatenated with “\\n” 55 | 56 | 57 | 58 | *Default:* 59 | ` "" ` 60 | -------------------------------------------------------------------------------- /examples/mkcert/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | 3 | { 4 | certificates = [ 5 | "example.com" 6 | "another-example.com" 7 | ]; 8 | 9 | hosts = { 10 | "example.com" = "127.0.0.1"; 11 | "another-example.com" = [ "127.0.0.1" "::1" ]; 12 | }; 13 | 14 | services.caddy.enable = true; 15 | services.caddy.virtualHosts."example.com" = { 16 | extraConfig = '' 17 | tls ${config.env.DEVENV_STATE}/mkcert/example.com.pem ${config.env.DEVENV_STATE}/mkcert/example.com-key.pem 18 | 19 | respond "Hello, world from example.com!" 20 | ''; 21 | }; 22 | services.caddy.virtualHosts."another-example.com" = { 23 | extraConfig = '' 24 | tls ${config.env.DEVENV_STATE}/mkcert/another-example.com.pem ${config.env.DEVENV_STATE}/mkcert/another-example.com-key.pem 25 | 26 | respond "Hello, world from another-example.com!" 27 | ''; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /src/modules/languages/ocaml.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.ocaml; 5 | in 6 | { 7 | options.languages.ocaml = { 8 | enable = lib.mkEnableOption "tools for OCaml development"; 9 | 10 | packages = lib.mkOption 11 | { 12 | type = lib.types.attrs; 13 | description = "The package set of OCaml to use"; 14 | default = pkgs.ocaml-ng.ocamlPackages; 15 | defaultText = lib.literalExpression "pkgs.ocaml-ng.ocamlPackages_4_12"; 16 | }; 17 | }; 18 | 19 | config = lib.mkIf cfg.enable { 20 | packages = [ 21 | cfg.packages.ocaml 22 | cfg.packages.dune_3 23 | cfg.packages.ocaml-lsp 24 | cfg.packages.merlin 25 | cfg.packages.utop 26 | cfg.packages.odoc 27 | cfg.packages.ocp-indent 28 | cfg.packages.findlib 29 | pkgs.ocamlformat 30 | ]; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /tests/cli/.test.sh: -------------------------------------------------------------------------------- 1 | set -xe 2 | 3 | rm devenv.yaml || true 4 | devenv build languages.python.package 5 | devenv shell ls -- -la | grep ".test.sh" 6 | devenv shell ls ../ | grep "cli" 7 | devenv info | grep "python3-" 8 | devenv show | grep "python3-" 9 | devenv search ncdu |& grep "Found 3 packages and 0 options for 'ncdu'" 10 | # there should be no processes 11 | devenv up && exit 1 12 | 13 | # Skip container tests on macOS 14 | if [[ "$(uname)" == "Darwin" ]]; then 15 | echo "Skipping container tests on macOS" 16 | exit 0 17 | fi 18 | 19 | # containers 20 | devenv container build shell && exit 1 21 | devenv inputs add mk-shell-bin github:rrbutani/nix-mk-shell-bin --follows nixpkgs 22 | devenv inputs add nix2container github:nlewo/nix2container --follows nixpkgs 23 | devenv container build shell | grep image-shell.json 24 | # bw compat 25 | devenv container shell | grep "image-shell.json" 26 | -------------------------------------------------------------------------------- /docs/supported-services/httpbin.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## services\.httpbin\.enable 7 | 8 | 9 | 10 | Whether to enable httpbin\. 11 | 12 | 13 | 14 | *Type:* 15 | boolean 16 | 17 | 18 | 19 | *Default:* 20 | ` false ` 21 | 22 | 23 | 24 | *Example:* 25 | ` true ` 26 | 27 | 28 | 29 | ## services\.httpbin\.bind 30 | 31 | Addresses for httpbin to listen on\. 32 | 33 | 34 | 35 | *Type:* 36 | list of string 37 | 38 | 39 | 40 | *Default:* 41 | 42 | ``` 43 | [ 44 | "127.0.0.1:8080" 45 | ] 46 | ``` 47 | 48 | 49 | 50 | ## services\.httpbin\.extraArgs 51 | 52 | 53 | 54 | Gunicorn CLI arguments for httpbin\. 55 | 56 | 57 | 58 | *Type:* 59 | list of string 60 | 61 | 62 | 63 | *Default:* 64 | ` [ ] ` 65 | -------------------------------------------------------------------------------- /docs/supported-services/elasticmq.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## services\.elasticmq\.enable 7 | 8 | Whether to enable elasticmq-server\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## services\.elasticmq\.package 28 | 29 | 30 | 31 | Which package of elasticmq-server-bin to use 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.elasticmq-server-bin ` 42 | 43 | 44 | 45 | ## services\.elasticmq\.settings 46 | 47 | 48 | 49 | Configuration for elasticmq-server 50 | 51 | 52 | 53 | *Type:* 54 | strings concatenated with “\\n” 55 | 56 | 57 | 58 | *Default:* 59 | ` "" ` 60 | -------------------------------------------------------------------------------- /devenv/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "devenv" 3 | version = "1.0.8" 4 | edition.workspace = true 5 | license.workspace = true 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | ansiterm.workspace = true 10 | clap.workspace = true 11 | cli-table.workspace = true 12 | dotlock.workspace = true 13 | fs2.workspace = true 14 | hex.workspace = true 15 | include_dir.workspace = true 16 | indoc.workspace = true 17 | miette.workspace = true 18 | nix.workspace = true 19 | regex.workspace = true 20 | reqwest.workspace = true 21 | schemars.workspace = true 22 | schematic.workspace = true 23 | serde.workspace = true 24 | serde_json.workspace = true 25 | serde_yaml.workspace = true 26 | sha2.workspace = true 27 | tempdir.workspace = true 28 | tracing.workspace = true 29 | which.workspace = true 30 | whoami.workspace = true 31 | xdg.workspace = true 32 | -------------------------------------------------------------------------------- /docs/supported-languages/texlive.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.texlive\.enable 7 | 8 | 9 | 10 | Whether to enable TeX Live\. 11 | 12 | 13 | 14 | *Type:* 15 | boolean 16 | 17 | 18 | 19 | *Default:* 20 | ` false ` 21 | 22 | 23 | 24 | *Example:* 25 | ` true ` 26 | 27 | 28 | 29 | ## languages\.texlive\.packages 30 | 31 | 32 | 33 | Packages available to TeX Live 34 | 35 | 36 | 37 | *Type:* 38 | non-empty (list of string) 39 | 40 | 41 | 42 | *Default:* 43 | 44 | ``` 45 | [ 46 | "collection-basic" 47 | ] 48 | ``` 49 | 50 | 51 | 52 | ## languages\.texlive\.base 53 | 54 | TeX Live package set to use 55 | 56 | 57 | 58 | *Type:* 59 | unspecified value 60 | 61 | 62 | 63 | *Default:* 64 | ` pkgs.texlive ` 65 | -------------------------------------------------------------------------------- /src/modules/services/elasticmq.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | let 4 | cfg = config.services.elasticmq; 5 | types = lib.types; 6 | in 7 | { 8 | options.services.elasticmq = { 9 | enable = lib.mkEnableOption "elasticmq-server"; 10 | 11 | package = lib.mkOption { 12 | type = types.package; 13 | description = "Which package of elasticmq-server-bin to use"; 14 | default = pkgs.elasticmq-server-bin; 15 | defaultText = lib.literalExpression "pkgs.elasticmq-server-bin"; 16 | }; 17 | 18 | settings = lib.mkOption { 19 | type = types.lines; 20 | default = ""; 21 | description = "Configuration for elasticmq-server"; 22 | }; 23 | }; 24 | 25 | config = lib.mkIf cfg.enable { 26 | processes.elasticmq-server.exec = "JAVA_TOOL_OPTIONS=\"-Dconfig.file=${pkgs.writeText "elasticmq-server.conf" cfg.settings}\" ${cfg.package}/bin/elasticmq-server"; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /docs/supported-languages/odin.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## languages\.odin\.enable 7 | 8 | 9 | 10 | Whether to enable tools for Odin Language\. 11 | 12 | 13 | 14 | *Type:* 15 | boolean 16 | 17 | 18 | 19 | *Default:* 20 | ` false ` 21 | 22 | 23 | 24 | *Example:* 25 | ` true ` 26 | 27 | 28 | 29 | ## languages\.odin\.package 30 | 31 | 32 | 33 | The odin package to use\. 34 | 35 | 36 | 37 | *Type:* 38 | package 39 | 40 | 41 | 42 | *Default:* 43 | ` pkgs.odin ` 44 | 45 | 46 | 47 | ## languages\.odin\.debugger 48 | 49 | An optional debugger package to use with odin\. 50 | The default is ` gdb `, if supported on the current system\. 51 | 52 | 53 | 54 | *Type:* 55 | null or package 56 | 57 | 58 | 59 | *Default:* 60 | ` pkgs.gdb ` 61 | -------------------------------------------------------------------------------- /docs/supported-services/dynamodb-local.md: -------------------------------------------------------------------------------- 1 | [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) 2 | 3 | 4 | [comment]: # (Please add your documentation on top of this line) 5 | 6 | ## services\.dynamodb-local\.enable 7 | 8 | Whether to enable DynamoDB Local\. 9 | 10 | 11 | 12 | *Type:* 13 | boolean 14 | 15 | 16 | 17 | *Default:* 18 | ` false ` 19 | 20 | 21 | 22 | *Example:* 23 | ` true ` 24 | 25 | 26 | 27 | ## services\.dynamodb-local\.package 28 | 29 | 30 | 31 | Which package of DynamoDB to use\. 32 | 33 | 34 | 35 | *Type:* 36 | package 37 | 38 | 39 | 40 | *Default:* 41 | ` pkgs.dynamodb-local ` 42 | 43 | 44 | 45 | ## services\.dynamodb-local\.port 46 | 47 | 48 | 49 | Listen address for the Dynamodb-local\. 50 | 51 | 52 | 53 | *Type:* 54 | 16 bit unsigned integer; between 0 and 65535 (both inclusive) 55 | 56 | 57 | 58 | *Default:* 59 | ` 8000 ` 60 | -------------------------------------------------------------------------------- /examples/ruby/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, ... }: 2 | 3 | { 4 | languages.ruby.enable = true; 5 | 6 | # Use a specific Ruby version. 7 | # languages.ruby.version = "3.2.1"; 8 | 9 | # Use a specific Ruby version from a .ruby-version file, compatible with rbenv. 10 | languages.ruby.versionFile = ./.ruby-version; 11 | 12 | # turn off C tooling if you do not intend to compile native extensions, enabled by default 13 | # languages.c.enable = false; 14 | 15 | enterShell = '' 16 | # Automatically run bundler upon enterting the shell. 17 | bundle 18 | ''; 19 | 20 | packages = [ 21 | pkgs.libyaml 22 | ] 23 | # Add required dependencies for macOS. These packages are usually provided as 24 | # part of the Xcode command line developer tools, in which case they can be 25 | # removed. 26 | # For more information, see the `--install` flag in `man xcode-select`. 27 | ++ lib.optionals pkgs.stdenv.isDarwin [ pkgs.libllvm ]; 28 | } 29 | -------------------------------------------------------------------------------- /src/modules/languages/nix.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.nix; 5 | cachix = "${lib.getBin config.cachix.package}"; 6 | 7 | # a bit of indirection to prevent mkShell from overriding the installed Nix 8 | vulnix = pkgs.buildEnv { 9 | name = "vulnix"; 10 | paths = [ pkgs.vulnix ]; 11 | pathsToLink = [ "/bin" ]; 12 | }; 13 | in 14 | { 15 | options.languages.nix = { 16 | enable = lib.mkEnableOption "tools for Nix development"; 17 | lsp.package = lib.mkOption { 18 | type = lib.types.package; 19 | default = pkgs.nil; 20 | defaultText = lib.literalExpression "pkgs.nil"; 21 | description = "The LSP package to use"; 22 | }; 23 | }; 24 | 25 | config = lib.mkIf cfg.enable { 26 | packages = with pkgs; [ 27 | statix 28 | deadnix 29 | cfg.lsp.package 30 | ] ++ (lib.optional config.cachix.enable cachix) ++ [ 31 | vulnix 32 | ]; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /examples/temporal/.test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -x 3 | 4 | export TEMPORAL_ADDRESS=127.0.0.1:17233 5 | 6 | # temporal status and store its exit status 7 | check_temporal_status() { 8 | echo "Waiting for service to become available..." 9 | TEMPORAL_OUTPUT=$(temporal operator cluster health) 10 | TEMPORAL_EXIT_STATUS=$? 11 | } 12 | 13 | # Continuously check temporal status until it returns successfully (up to a maximum of 20 times) 14 | # shellcheck disable=SC2034 15 | for i in $(seq 1 20); do 16 | check_temporal_status 17 | if [ $TEMPORAL_EXIT_STATUS -eq 0 ]; then 18 | echo "Service is up..." 19 | break 20 | else 21 | sleep 1 22 | fi 23 | done 24 | 25 | echo "Checking namespace..." 26 | temporal operator namespace describe mynamespace 27 | 28 | # Print the captured output when temporal status succeeds 29 | echo "Startup complete..." 30 | temporal operator cluster system 31 | echo "$TEMPORAL_OUTPUT" 32 | 33 | # Exit the script 34 | exit "$TEMPORAL_EXIT_STATUS" 35 | -------------------------------------------------------------------------------- /examples/python-django/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, ... }: 2 | 3 | let 4 | db_user = "postgres"; 5 | db_name = "db"; 6 | in 7 | { 8 | languages.python = { 9 | enable = true; 10 | version = "3.11"; 11 | poetry.enable = true; 12 | }; 13 | 14 | # To load secrets like SECRET_KEY from .env 15 | # dotenv.enable = true; 16 | 17 | env = { 18 | DATABASE_URL = "postgres://${db_user}@/${db_name}?host=${config.env.PGHOST}"; 19 | DEBUG = true; 20 | SECRET_KEY = "supersecret"; 21 | STATIC_ROOT = config.devenv.state + "/static"; 22 | }; 23 | 24 | services.postgres = { 25 | enable = true; 26 | initialScript = "CREATE USER ${db_user} SUPERUSER;"; 27 | initialDatabases = [{ name = db_name; }]; 28 | }; 29 | 30 | processes.runserver = { 31 | exec = "python manage.py runserver"; 32 | process-compose.depends_on.postgres.condition = "process_healthy"; 33 | }; 34 | 35 | enterTest = '' 36 | python manage.py test 37 | ''; 38 | } 39 | -------------------------------------------------------------------------------- /src/modules/services/httpbin.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, ... }: 2 | 3 | let 4 | cfg = config.services.httpbin; 5 | 6 | qs = lib.escapeShellArgs; 7 | 8 | python = pkgs.python3.withPackages (ps: with ps; [ httpbin gunicorn gevent ]); 9 | binds = lib.concatMap (addr: [ "-b" addr ]) cfg.bind; 10 | in 11 | { 12 | options.services.httpbin = { 13 | enable = lib.mkEnableOption "httpbin"; 14 | 15 | bind = lib.mkOption { 16 | type = with lib.types; listOf str; 17 | default = [ "127.0.0.1:8080" ]; 18 | description = "Addresses for httpbin to listen on."; 19 | }; 20 | 21 | extraArgs = lib.mkOption { 22 | type = with lib.types; listOf str; 23 | default = [ ]; 24 | description = "Gunicorn CLI arguments for httpbin."; 25 | }; 26 | }; 27 | 28 | config = lib.mkIf cfg.enable { 29 | processes.httpbin.exec = '' 30 | exec ${python}/bin/gunicorn httpbin:app -k gevent ${qs binds} ${qs cfg.extraArgs} 31 | ''; 32 | }; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /devenv/init/devenv.nix: -------------------------------------------------------------------------------- 1 | { pkgs, lib, config, inputs, ... }: 2 | 3 | { 4 | # https://devenv.sh/basics/ 5 | env.GREET = "devenv"; 6 | 7 | # https://devenv.sh/packages/ 8 | packages = [ pkgs.git ]; 9 | 10 | # https://devenv.sh/languages/ 11 | # languages.rust.enable = true; 12 | 13 | # https://devenv.sh/processes/ 14 | # processes.cargo-watch.exec = "cargo-watch"; 15 | 16 | # https://devenv.sh/services/ 17 | # services.postgres.enable = true; 18 | 19 | # https://devenv.sh/scripts/ 20 | scripts.hello.exec = '' 21 | echo hello from $GREET 22 | ''; 23 | 24 | enterShell = '' 25 | hello 26 | git --version 27 | ''; 28 | 29 | # https://devenv.sh/tests/ 30 | enterTest = '' 31 | echo "Running tests" 32 | git --version | grep --color=auto "${pkgs.git.version}" 33 | ''; 34 | 35 | # https://devenv.sh/pre-commit-hooks/ 36 | # pre-commit.hooks.shellcheck.enable = true; 37 | 38 | # See full reference at https://devenv.sh/reference/options/ 39 | } 40 | -------------------------------------------------------------------------------- /src/modules/languages/purescript.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.purescript; 5 | # supported via rosetta 6 | supportAarch64Darwin = package: package.overrideAttrs (attrs: { 7 | meta = attrs.meta // { 8 | platforms = lib.platforms.linux ++ lib.platforms.darwin; 9 | }; 10 | }); 11 | in 12 | { 13 | options.languages.purescript = { 14 | enable = lib.mkEnableOption "tools for PureScript development"; 15 | 16 | package = lib.mkOption { 17 | type = lib.types.package; 18 | default = (supportAarch64Darwin pkgs.purescript); 19 | defaultText = lib.literalExpression "pkgs.purescript"; 20 | description = "The PureScript package to use."; 21 | }; 22 | 23 | }; 24 | 25 | config = lib.mkIf cfg.enable { 26 | packages = [ 27 | cfg.package 28 | pkgs.nodePackages.purescript-language-server 29 | pkgs.nodePackages.purs-tidy 30 | pkgs.purescript-psa 31 | (supportAarch64Darwin pkgs.psc-package) 32 | ]; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /src/modules/languages/c.nix: -------------------------------------------------------------------------------- 1 | { pkgs, config, lib, ... }: 2 | 3 | let 4 | cfg = config.languages.c; 5 | in 6 | { 7 | options.languages.c = { 8 | enable = lib.mkEnableOption "tools for C development"; 9 | 10 | debugger = lib.mkOption { 11 | type = lib.types.nullOr lib.types.package; 12 | default = 13 | if lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.gdb 14 | then pkgs.gdb 15 | else null; 16 | defaultText = lib.literalExpression "pkgs.gdb"; 17 | description = '' 18 | An optional debugger package to use with c. 19 | The default is `gdb`, if supported on the current system. 20 | ''; 21 | }; 22 | }; 23 | 24 | config = lib.mkIf cfg.enable { 25 | packages = with pkgs; [ 26 | stdenv 27 | gnumake 28 | ccls 29 | pkg-config 30 | ] ++ lib.optional (cfg.debugger != null) cfg.debugger 31 | ++ lib.optional (lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.valgrind && !pkgs.valgrind.meta.broken) pkgs.valgrind; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = [ 4 | "devenv", 5 | "devenv-run-tests", 6 | "xtask", 7 | ] 8 | 9 | [workspace.package] 10 | edition = "2021" 11 | license = "APACHE-2.0" 12 | license_file = "LICENSE" 13 | homepage = "https://devenv.sh/" 14 | repository = "https://github.com/cachix/devenv/" 15 | 16 | [workspace.dependencies] 17 | ansiterm = "0.12.2" 18 | clap = { version = "4.5.1", features = ["derive", "cargo"] } 19 | cli-table = "0.4.7" 20 | dotlock = "0.5.0" 21 | fs2 = "0.4.3" 22 | hex = "0.4.3" 23 | include_dir = "0.7.3" 24 | indoc = "2.0.4" 25 | miette = { version = "7.1.0", features = ["fancy"] } 26 | nix = { version = "0.28.0", features = ["signal"] } 27 | regex = "1.10.3" 28 | reqwest = "0.11.26" 29 | schematic = { version = "0.14.3", features = ["schema", "yaml", "renderer_template", "renderer_json_schema"] } 30 | serde = "1.0.197" 31 | serde_json = "1.0.114" 32 | serde_yaml = "0.9.32" 33 | sha2 = "0.10.8" 34 | tempdir = "0.3.7" 35 | tracing = "0.1.40" 36 | which = "6.0.0" 37 | whoami = "1.5.1" 38 | xdg = "2.5.2" 39 | 40 | schemars = "0.8.16" 41 | --------------------------------------------------------------------------------