Skip to content

Commit 95b61c5

Browse files
committed
feat: add Nix flake for reproducible development environment
Add comprehensive Nix flake providing all required tools: - Rust toolchain with rust-analyzer, clippy, rustfmt - Elixir 1.16 + Erlang/OTP 26 - Haskell GHC 9.6 + Cabal + HLS + common libraries - Idris 2 from official flake - Nickel for configuration validation Development environment features: - `nix develop` enters full polyglot shell - Specialized shells: `nix develop .#rust`, `.#haskell`, `.#elixir` - direnv integration via .envrc - Automatic library path setup for native dependencies Also includes: - justfile with comprehensive task definitions - Cargo.lock tracked for reproducible builds - Updated Makefile with `make shell` target
1 parent a1dfad4 commit 95b61c5

6 files changed

Lines changed: 1650 additions & 2 deletions

File tree

.envrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# SPDX-License-Identifier: MIT AND Palimpsest-0.8
2+
# SPDX-FileCopyrightText: 2024-2025 The polysafe-gitfixer Contributors
3+
#
4+
# direnv configuration for polysafe-gitfixer
5+
# Automatically loads the Nix development environment
6+
#
7+
# Setup:
8+
# 1. Install direnv: https://direnv.net/docs/installation.html
9+
# 2. Hook into your shell: eval "$(direnv hook bash)" # or zsh/fish
10+
# 3. Allow this directory: direnv allow
11+
#
12+
# The environment will automatically load when you cd into this directory.
13+
14+
use flake
15+
16+
# Optional: Add local bin to PATH
17+
PATH_add bin
18+
19+
# Optional: Watch additional files for changes
20+
watch_file flake.nix
21+
watch_file flake.lock

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Rust
66
# ==============================================================================
77
target/
8-
Cargo.lock
8+
# Note: Cargo.lock IS tracked for reproducible Nix builds
99
**/*.rs.bk
1010
*.pdb
1111

@@ -68,6 +68,11 @@ result
6868
result-*
6969
.direnv/
7070

71+
# Local Nix shell directories (created by shellHook)
72+
.nix-mix/
73+
.nix-hex/
74+
.cabal/
75+
7176
# ==============================================================================
7277
# Editor/IDE
7378
# ==============================================================================

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
.PHONY: all rust haskell idris elixir clean test check fmt
1+
# SPDX-License-Identifier: MIT AND Palimpsest-0.8
2+
# SPDX-FileCopyrightText: 2024-2025 The polysafe-gitfixer Contributors
3+
4+
.PHONY: all rust haskell idris elixir clean test check fmt shell
25

36
# Default target: build everything
47
all: rust haskell idris elixir
@@ -86,6 +89,10 @@ clean:
8689
watch-rust:
8790
cd crates && cargo watch -x check
8891

92+
# Nix development shell
93+
shell:
94+
nix develop
95+
8996
# Help
9097
help:
9198
@echo "polysafe-gitfixer build system"
@@ -101,4 +108,5 @@ help:
101108
@echo " check - Type check without building"
102109
@echo " fmt - Format all code"
103110
@echo " clean - Remove build artifacts"
111+
@echo " shell - Enter Nix development shell"
104112
@echo " help - Show this help"

0 commit comments

Comments
 (0)