summaryrefslogtreecommitdiff
path: root/modules/examples
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2019-09-24 00:26:29 +0200
committerDaiderd Jordan <daiderd@gmail.com>2019-09-24 00:27:53 +0200
commitda52dc006c42e25757f7b2f4aac398cf448a389d (patch)
tree87122e7171a3b8008ff91a12cd6af45d9196548a /modules/examples
parente274978a6573e5e1a37cb39dcd9abf1217388223 (diff)
lnl: load :u packages in current instead of a subshell
Diffstat (limited to 'modules/examples')
-rw-r--r--modules/examples/lnl.nix16
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix
index 99a77e8..cda7e19 100644
--- a/modules/examples/lnl.nix
+++ b/modules/examples/lnl.nix
@@ -168,6 +168,8 @@
# Dotfiles.
# programs.vim.package = mkForce pkgs.lnl.vim;
+ programs.bash.enableCompletion = true;
+
programs.zsh.enable = true;
programs.zsh.enableBashCompletion = true;
programs.zsh.enableFzfCompletion = true;
@@ -201,10 +203,6 @@
nix repl ''${@:-<dotpkgs>}
}
- :u() {
- nix run -f '<dotpkgs>' "$1" "$@"
- }
-
:d() {
eval "$(direnv hook zsh)"
}
@@ -213,6 +211,16 @@
direnv reload
}
+ :u() {
+ local exports
+
+ exports=$(direnv apply_dump <(nix-shell -E "with import <dotpkgs> {}; mkShell { buildInputs = [ $* ]; }" --run 'direnv dump'))
+ eval "$exports"
+
+ name+="''${name:+ }$*"
+ typeset -U PATH
+ }
+
xi() {
curl -F 'f:1=<-' ix.io
}