47 locate-dominating-file,
83 module1 = resholve.mkDerivation {
85 version = "unreleased";
88 setSourceRoot = "sourceRoot=$(echo */tests/nix/libressl)";
91 mkdir -p $out/{bin,submodule}
92 install libressl.sh $out/bin/libressl.sh
93 install submodule/helper.sh $out/submodule/helper.sh
98 # submodule to demonstrate
101 "submodule/helper.sh"
103 interpreter = "none";
112 is_it_okay_with_arbitrary_envs = "shonuff";
114 module2 = resholve.mkDerivation {
116 version = "unreleased";
119 setSourceRoot = "sourceRoot=$(echo */tests/nix/openssl)";
122 mkdir -p $out/bin $out/libexec
123 install openssl.sh $out/bin/openssl.sh
124 install libexec.sh $out/libexec/invokeme
125 install profile $out/profile
137 interpreter = "none";
146 This is the same verdict binlore will
147 come up with. It's a no-op just to demo
148 how to fiddle lore via the Nix API.
150 "cannot:${openssl.bin}/bin/openssl"
151 # different verdict, but not used
152 "can:${openssl.bin}/bin/c_rehash"
156 scripts = [ "profile" ];
157 interpreter = "none";
162 # demonstrate that we could use resholve in larger build
163 module3 = stdenv.mkDerivation {
165 version = "unreleased";
168 setSourceRoot = "sourceRoot=$(echo */tests/nix/future_perfect_tense)";
172 install conjure.sh $out/bin/conjure.sh
173 ${resholve.phraseSolution "conjure" {
174 scripts = [ "bin/conjure.sh" ];
175 interpreter = "${bash}/bin/bash";
176 inputs = [ module1 ];
187 cli = stdenv.mkDerivation {
188 name = "resholve-test";
199 buildInputs = [ resholve ];
200 nativeCheckInputs = [
207 RESHOLVE_PATH = "${lib.makeBinPath default_packages}";
208 # but separate packages for combining as needed
209 PKG_FILE = "${lib.makeBinPath [ file ]}";
210 PKG_FINDUTILS = "${lib.makeBinPath [ findutils ]}";
211 PKG_GETTEXT = "${lib.makeBinPath [ gettext ]}";
212 PKG_COREUTILS = "${lib.makeBinPath [ coreutils ]}";
213 RESHOLVE_LORE = "${binlore.collect {
214 drvs = default_packages ++ [ coreutils ] ++ parsed_packages;
216 PKG_PARSED = "${lib.makeBinPath parsed_packages}";
218 # explicit interpreter for demo suite; maybe some better way...
219 INTERP = "${bash}/bin/bash";
225 touch empty_lore/{execers,wrappers}
226 export EMPTY_LORE=$PWD/empty_lore
227 printf "\033[33m============================= resholve test suite ===================================\033[0m\n" > test.ansi
228 if ./test.sh &>> test.ansi; then
231 cat test.ansi && exit 1
234 + lib.optionalString runDemo ''
235 printf "\033[33m============================= resholve demo ===================================\033[0m\n" > demo.ansi
236 if ./demo &>> demo.ansi; then
239 cat demo.ansi && exit 1
244 # Caution: ci.nix asserts the equality of both of these w/ diff
246 resholve.writeScript "resholved-script"
249 interpreter = "${bash}/bin/bash";
256 resholve.writeScriptBin "resholved-script-bin"
259 interpreter = "${bash}/bin/bash";
265 resholvedScriptBinNone =
266 resholve.writeScriptBin "resholved-script-bin"
269 interpreter = "none";
275 # spot-check lore overrides
277 resholve.writeScriptBin "verify-overrides"
291 ++ lib.optionals stdenv.hostPlatform.isLinux [
295 interpreter = "none";
297 "cannot:${esh}/bin/esh"
318 + lib.optionalString stdenv.hostPlatform.isLinux ''
319 nixos-generate-config fake args
320 nixos-rebuild fake args
324 # ensure known consumers in nixpkgs keep working
326 inherit bashup-events32;
331 inherit locate-dominating-file;
341 // lib.optionalAttrs stdenv.hostPlatform.isLinux {
342 inherit arch-install-scripts;
345 inherit unix-privesc-check;
352 (stdenv.hostPlatform.isLinux && (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64))
354 inherit s0ix-selftest-tool;