on main help sign in
feat: add Nix flake for development environment (#2512)
commit452cd75277496b7a0203d70064ce91253b4ea434 authorKieran Klukas <me@dunkirk.sh> dateTue 5 May 2026, 11:31 (5 months ago) parentb64cb02
4 files changed+109
.envrc+1 .gitignore+3 flake.lock+61 flake.nix+44
.envrcnew file+1
@@ -0,0 +1 @@
1+use flake
.gitignore+3
@@ -42,6 +42,9 @@ Thumbs.db
4242.env
4343.env.local
4444
45+# Nix/direnv
46+.direnv/
47+
4548**/.crush/**
4649
4750/crush
flake.locknew file+61
@@ -0,0 +1,61 @@
1+{
2+ "nodes": {
3+ "flake-utils": {
4+ "inputs": {
5+ "systems": "systems"
6+ },
7+ "locked": {
8+ "lastModified": 1731533236,
9+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
10+ "owner": "numtide",
11+ "repo": "flake-utils",
12+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
13+ "type": "github"
14+ },
15+ "original": {
16+ "owner": "numtide",
17+ "repo": "flake-utils",
18+ "type": "github"
19+ }
20+ },
21+ "nixpkgs": {
22+ "locked": {
23+ "lastModified": 1775423009,
24+ "narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=",
25+ "owner": "NixOS",
26+ "repo": "nixpkgs",
27+ "rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9",
28+ "type": "github"
29+ },
30+ "original": {
31+ "owner": "NixOS",
32+ "ref": "nixos-unstable",
33+ "repo": "nixpkgs",
34+ "type": "github"
35+ }
36+ },
37+ "root": {
38+ "inputs": {
39+ "flake-utils": "flake-utils",
40+ "nixpkgs": "nixpkgs"
41+ }
42+ },
43+ "systems": {
44+ "locked": {
45+ "lastModified": 1681028828,
46+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
47+ "owner": "nix-systems",
48+ "repo": "default",
49+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
50+ "type": "github"
51+ },
52+ "original": {
53+ "owner": "nix-systems",
54+ "repo": "default",
55+ "type": "github"
56+ }
57+ }
58+ },
59+ "root": "root",
60+ "version": 7
61+}
flake.nixnew file+44
@@ -0,0 +1,44 @@
1+{
2+ description = "Crush development environment";
3+
4+ inputs = {
5+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+ flake-utils.url = "github:numtide/flake-utils";
7+ };
8+
9+ outputs = {
10+ self,
11+ nixpkgs,
12+ flake-utils,
13+ }:
14+ flake-utils.lib.eachDefaultSystem (
15+ system: let
16+ pkgs = nixpkgs.legacyPackages.${system};
17+ in {
18+ devShells.default = pkgs.mkShell {
19+ buildInputs = with pkgs; [
20+ # Go toolchain
21+ go_1_26
22+
23+ # Development tools
24+ gopls # Go language server
25+ golangci-lint # Linter
26+ gofumpt # Formatter (stricter than gofmt)
27+ go-task # Task runner
28+ delve # Go debugger
29+
30+ # Additional tools
31+ git # Version control
32+ gh # GitHub CLI
33+ svu # Semantic version utility
34+ sqlc # SQL code generator
35+ ];
36+
37+ shellHook = ''
38+ # Set Go environment variables
39+ export CGO_ENABLED=0
40+ '';
41+ };
42+ }
43+ );
44+}