summaryrefslogtreecommitdiff
path: root/conf.d/99-nix.zsh
diff options
context:
space:
mode:
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