aboutsummaryrefslogtreecommitdiff
path: root/.vim/snippets/shell.nix
diff options
context:
space:
mode:
Diffstat (limited to '.vim/snippets/shell.nix')
-rw-r--r--.vim/snippets/shell.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/.vim/snippets/shell.nix b/.vim/snippets/shell.nix
new file mode 100644
index 0000000..2e58365
--- /dev/null
+++ b/.vim/snippets/shell.nix
@@ -0,0 +1,22 @@
+let
+
+ name = "nix-shell.pure";
+ pkgs = import <nixpkgs> { };
+
+ shell = pkgs.writeShellApplication {
+ inherit name;
+ text = ''
+ /usr/bin/env --ignore-environment /bin/sh -c ${
+ pkgs.writeScript name ''
+ export PS1='\h (${name}) \W \$ '
+ export PATH=${pkgs.lib.strings.makeBinPath [ pkgs.busybox ]}
+ /bin/sh
+ ''
+ };
+ '';
+ };
+
+in pkgs.mkShell {
+ inherit name;
+ shellHook = "exec ${shell}/bin/${shell.name}";
+}