# defeats the recursion checks of nix and will cause it to # loop infinitely. well, almost, anyways. # # annoyingly, nix doesn't have tail recursion, so actually # it'll eventually terminate with a stack overflow. let pkgs = import {}; writeTextVerbose = file: content: pkgs.stdenv.mkDerivation { name = file; src = pkgs.hello; buildPhase = '' echo ${pkgs.lib.escapeShellArg content} > $out ''; installPhase = '' echo wrote file to $name ''; }; storefile = v: writeTextVerbose "nixfile" '' { x = ${toString v}; } ''; loop = a: let file = import (storefile a); in if file.x == 1 then loop a else "done"; in loop 1