From fb51c8b458bab2002949b3fad9aaaccda035196d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 27 Jan 2020 11:39:02 +0000 Subject: [PATCH] Support nix-eval fish function Wrapping the `nix eval` incantation in a fish function for two reasons: 1. Document that this is how to evaluate Nix from a file. 2. Provide a more ergonomic way of evaluating Nix from a file. --- configs/shared/.config/fish/config.fish | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configs/shared/.config/fish/config.fish b/configs/shared/.config/fish/config.fish index 830b4bb19..eeb799c71 100644 --- a/configs/shared/.config/fish/config.fish +++ b/configs/shared/.config/fish/config.fish @@ -1,6 +1,5 @@ # While I work use a variety of programs, below of some of my more commonly used -# programs that I have decided to support with aliases. -# Applications +# programs that I have decided to support with aliases. # Applications # java: jv # tmux: t # $EDITOR: e @@ -76,6 +75,13 @@ function fish_prompt echo -e "\n$suffix " end +function nix-eval --description 'Evaluate Nix expression from file, $1.' + # Notice the empty string at the end of the invocation here. This is + # intentional. For more information, see this issue: + # https://github.com/NixOS/nix/issues/2078 + nix eval --file $argv[1] "" +end + # Setup fzf for fuzzily finding commands, files, directories source (fzf-share)/key-bindings.fish && fzf_key_bindings