diff --git a/bin/hey b/bin/hey index a0961c16..2f1a0f20 100755 --- a/bin/hey +++ b/bin/hey @@ -87,7 +87,13 @@ module Hey defcmd :repl do desc "Open a nix-repl with nixpkgs and dotfiles preloaded" lambda do |args| - sh ["nix", "repl", "", *args] + tempfile = '/tmp/dotfiles-repl.nix' + File.write('/tmp/dotfiles-repl.nix', "(builtins.getFlake \"#{@@opts[:flake]}\")") + begin + sh ["nix", "repl", "", tempfile, *args] + ensure + File.delete tempfile + end end end