Nix Devshells

Nix + direnv

ComeOnOliver Updated 61 repo stars

File contents

Nix + direnv

.envrc

use flake

flake.nix

{
  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system: let
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      devShells.default = pkgs.mkShell {
        packages = with pkgs; [ nodejs_20 pnpm python311 postgresql_16 redis ];
        env.DATABASE_URL = "postgresql://localhost/myapp";
      };
    });
}

cd into directory → environment auto-activates

Everyone on team gets exact same tools

direnv allow once, then automatic

ComeOnOliver/skillshub/tree/main/skills/skillshub-team/catalog-batch5/nix-devshells commit 4e84e3abfc

Frequently asked questions

npx skillmds@latest add comeonoliver/nix-devshells