Skip to content

Commit 4f900fa

Browse files
feat: Add Nix flake development environment setup
- Add flake.nix with nixpkgs 25.05, Node.js 22 LTS, pnpm, and OpenJDK - Configure .envrc for direnv integration with ROOT environment variable - Update README.md with Nix setup instructions and prerequisites - Add .direnv/ to .gitignore for local cache exclusion - Generate flake.lock for reproducible dependency versions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e627636 commit 4f900fa

File tree

6 files changed

+110
-7
lines changed

6 files changed

+110
-7
lines changed

.envrc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/usr/bin/env bash
22

3-
# (non-sensitive) project environment variables:
4-
export REPO="$(expand_path .)"
3+
use flake
54

6-
# Load environment variables from .env file(s)
7-
set -a
8-
source .env
9-
source .env.development
10-
set +a
5+
export ROOT="$(expand_path .)"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ firebase-debug.log
4646
*.tsbuildinfo
4747
next-env.d.ts
4848

49+
# direnv
50+
.direnv/
51+
4952
# misc
5053
firestore-debug.log
5154
redirect-to-wellmaintained/.firebase/hosting.cHVibGlj.cache

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,23 @@ https://decision-copilot.wellmaintained.org/
5353

5454
## Development
5555

56+
### Prerequisites
57+
58+
The project uses Nix for reproducible development environments. You have two options:
59+
60+
**Option 1: With Nix + direnv (Recommended)**
61+
```bash
62+
# Install nix and direnv, then:
63+
direnv allow
64+
pnpm run dev
65+
```
66+
67+
**Option 2: Without Nix**
68+
Ensure you have:
69+
- Node.js 22 LTS
70+
- pnpm
71+
- OpenJDK (for Firebase emulators)
72+
5673
### Quick Start
5774

5875
```bash

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
description = "Decision Copilot Development Environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs { inherit system; };
13+
in {
14+
devShells.default = pkgs.mkShell {
15+
buildInputs = with pkgs; [
16+
nodejs_22 # Latest LTS (22.x)
17+
pnpm # Package manager
18+
jdk # OpenJDK for Firebase emulators
19+
];
20+
};
21+
});
22+
}

pnpm-workspace.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
onlyBuiltDependencies:
2+
- esbuild
3+
- protobufjs
4+
- re2
5+
- sharp

0 commit comments

Comments
 (0)