Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dev Shells

Development environments defined in flake/dev-shells.nix.

Available Shells

    devShells = {
      # For work on this repository. Installs every hook on shell entry, and
      # carries the commands an agent session is held to: check-one,
      # hygiene-scan and module-coverage.
      default = shellFor (portableHooks // repositoryHooks) agentTools;

      # For a flake that re-exports the shell. Same tools, portable hooks only.
      # The repository hooks check this repository's own tree and reject any
      # other, so a consumer points its default here:
      #   devShells.default = inputs'.othrys.devShells.consumer;
      consumer = shellFor portableHooks [];

      javascript = pkgs.mkShell {
        name = "javascript-dev";
        packages = with pkgs; [
          nodejs_22
          pnpm
          yarn
          bun
          typescript
          typescript-language-server
          eslint
          prettier
          # No vite. pkgs.vite is ViTE, a trace viewer for Linux, and a
          # project takes the Vite build tool from its own dependencies.
        ];
      };

      python = pkgs.mkShell {
        name = "python-dev";
        packages = with pkgs; [
          python312
          python312Packages.pip
          python312Packages.virtualenv
          poetry
          python312Packages.black
          python312Packages.pylint
          python312Packages.pytest
          python312Packages.python-lsp-server
        ];
      };

      golang = pkgs.mkShell {
        name = "golang-dev";
        packages = with pkgs; [
          go
          gopls
          gotools
          go-tools
          delve
          golangci-lint
        ];
        shellHook = ''
          export GOPATH="$HOME/go"
          export PATH="$GOPATH/bin:$PATH"
        '';
      };

      java = pkgs.mkShell {
        name = "java-dev";
        packages = with pkgs; [
          jdk21
          maven
          gradle
        ];
      };

      iac = pkgs.mkShell {
        name = "iac-dev";
        packages = with pkgs; [
          opentofu
          terraform-ls
          tflint
          ansible
          ansible-lint
          awscli2
          kubectl
          kubernetes-helm
          k9s
          sops
          age
        ];
      };

      rust = pkgs.mkShell {
        name = "rust-dev";
        packages = with pkgs; [
          rustc
          cargo
          rust-analyzer
          rustfmt
          clippy
          cargo-watch
          cargo-edit
          cargo-audit
        ];
        RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
      };
    };

Usage

# Enter the default shell (Nix tooling + pre-commit hooks)
just dev

# Enter a specific shell
just dev javascript
just dev python
just dev golang
just dev java
just dev iac
just dev rust

Direnv Integration

The repository includes an .envrc that automatically activates the default dev shell when you enter the directory. This provides Nix tooling and pre-commit hooks without manual nix develop.

Adding a New Shell

Add a new entry to the devShells attrset in flake/dev-shells.nix:

myshell = pkgs.mkShell {
  name = "myshell-dev";
  packages = with pkgs; [ ... ];
};