File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ use flake
Original file line number Diff line number Diff line change @@ -10,3 +10,5 @@ elm-stuff/
1010* .zip
1111packged /
1212out-tsc /
13+ .direnv /
14+ .corepack /
Original file line number Diff line number Diff line change 1+ {
2+ description = "wolfcola-devtools development environment" ;
3+
4+ inputs = {
5+ nixpkgs . url = "github:NixOS/nixpkgs/nixpkgs-unstable" ;
6+ systems . url = "github:nix-systems/default" ;
7+ } ;
8+
9+ outputs =
10+ {
11+ nixpkgs ,
12+ systems ,
13+ ...
14+ } :
15+ let
16+ eachSystem = nixpkgs . lib . genAttrs ( import systems ) ;
17+ in
18+ {
19+ devShells = eachSystem (
20+ system :
21+ let
22+ pkgs = nixpkgs . legacyPackages . ${ system } ;
23+ in
24+ {
25+ default = pkgs . mkShell {
26+ packages = with pkgs ; [
27+ nodejs_24
28+ corepack
29+ lefthook
30+ ] ;
31+
32+ shellHook = ''
33+ corepack enable --install-directory "$PWD/.corepack" >/dev/null 2>&1
34+ export PATH="$PWD/.corepack:$PATH"
35+
36+ if [ ! -d node_modules ]; then
37+ echo "node_modules missing — running pnpm install..."
38+ pnpm install
39+ elif [ pnpm-lock.yaml -nt node_modules ]; then
40+ echo "pnpm-lock.yaml is newer than node_modules — running pnpm install..."
41+ pnpm install
42+ fi
43+ '' ;
44+ } ;
45+ }
46+ ) ;
47+
48+ formatter = eachSystem ( system : nixpkgs . legacyPackages . ${ system } . nixfmt ) ;
49+ } ;
50+ }
You can’t perform that action at this time.
0 commit comments