From ab2e052ba34e89c869a0617769be90df83cf9da2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 28 Feb 2021 22:29:55 -0500 Subject: [PATCH] bin/hey: fix repl command Now loads nixpkgs and dotfiles flake. --- bin/hey | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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