File tree Expand file tree Collapse file tree 2 files changed +24
-24
lines changed
Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Original file line number Diff line number Diff line change 125125 fi
126126 '' ;
127127 } ;
128+
129+ test-templates = pkgs . writeShellApplication {
130+ name = "test-templates" ;
131+ text = ''
132+ env -i PATH="${
133+ with pkgs ;
134+ lib . makeBinPath [
135+ direnv
136+ nix
137+ coreutils
138+ jq
139+ bash
140+ ]
141+ } " ${ pkgs . bash } /bin/bash --noprofile --norc ${ ./test-templates.bash }
142+ '' ;
143+ } ;
144+
128145 } ;
129146
130147 apps = perSystem (
150167 program = "${ ( libs pkgs ) . genFlakes } /bin/gen-flakes" ;
151168 } ;
152169
153- test-templates =
154- let
155- app =
156- with pkgs ;
157- writeShellApplication {
158- name = "test-templates" ;
159- runtimeInputs = [
160- direnv
161- nix
162- coreutils
163- jq
164- ] ;
165- text = lib . readFile ./test-templates.bash ;
166- } ;
167- in
168- {
169- type = "app" ;
170- program = "${ app } /bin/test-templates" ;
171- } ;
170+ test-templates = {
171+ type = "app" ;
172+ program = "${ ( libs pkgs ) . test-templates } /bin/test-templates" ;
173+ } ;
172174 }
173175 ) ;
174176
Original file line number Diff line number Diff line change 44
55base=" $PWD "
66function test_template() {
7- set -euo pipefail
7+ set -vaeuo pipefail
8+ env
89 template=" $1 "
910 echo " ===== $template =====" | tr ' [:print:]' ' ='
1011 echo " || $template ||"
@@ -15,17 +16,14 @@ function test_template() {
1516 echo " extra-experimental-features = nix-command flakes" > " $HOME /.config/nix/nix.conf"
1617
1718 cd " $out "
18- touch " $out /.envrc" && direnv deny " $out " # temporarily until we setup .envrc
1919
2020 cp -rf " $base /$template " /* " $out /"
2121
2222 nix run " path:$base " --show-trace
2323 test -e " $HOME /.config/direnv/lib/use_devshell_toml.sh"
2424
2525 # use bash strict inside .envrc
26- echo " set -euo pipefail; source $HOME /.config/direnv/lib/use_devshell_toml.sh; use devshell_toml --show-trace" > " $out /.envrc"
27-
28- direnv allow " $out "
26+ echo " set -euo pipefail; source $HOME /.config/direnv/lib/use_devshell_toml.sh; use devshell_toml --show-trace" > " $out /.envrc" && direnv allow " $out "
2927 direnv exec " $out " check
3028}
3129
You can’t perform that action at this time.
0 commit comments