summaryrefslogtreecommitdiff
path: root/conf.d/99-nix.zsh
diff options
context:
space:
mode:
authorTill Höppner2019-04-01 21:02:48 +0200
committerTill Höppner2019-04-01 21:02:48 +0200
commitd502ebb035c51a69229e214d539d507fcdeaec30 (patch)
treecaea3e47b85c736a251e51c460ae73edfb4c8c5e /conf.d/99-nix.zsh
parent3c3d674ff491481d9b6f5848d00d010592ab0d93 (diff)
downloadzsh-d502ebb035c51a69229e214d539d507fcdeaec30.tar.gz
zsh-d502ebb035c51a69229e214d539d507fcdeaec30.tar.xz
zsh-d502ebb035c51a69229e214d539d507fcdeaec30.zip
nix: add nipr alias
Diffstat (limited to 'conf.d/99-nix.zsh')
-rw-r--r--conf.d/99-nix.zsh11
1 files changed, 11 insertions, 0 deletions
diff --git a/conf.d/99-nix.zsh b/conf.d/99-nix.zsh
index 8b877a3..200ebae 100644
--- a/conf.d/99-nix.zsh
+++ b/conf.d/99-nix.zsh
@@ -4,11 +4,21 @@ function cnip() {
cd $(nip "$1")
}
+function nipr() {
+ local remote="$1"
+ local package="$2"
+
+ local drv="$(nix-instantiate '<nixpkgs>' -A "$package")"
+ nix-copy-closure --to "$remote" "$drv"
+ ssh "$remote" nix-store -r "$drv"
+}
+
function with() {
PKG="$1"
shift
nix-shell -p "$PKG" --run "$@"
}
+alias zwith='nix-shell --run zsh -p'
alias niv='nix eval -f "<nixpkgs>"'
alias nic=nix-channel
@@ -18,6 +28,7 @@ alias nir="nix repl '<nixpkgs>'"
alias nio=nixops
alias nied='nix edit -f "<nixpkgs>"'
alias nidf='EDITOR=echo nied'
+alias nii="nix-instantiate '<nixpkgs>' -A"
alias nor=nixos-rebuild
alias noc=nixos-container