aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@users.noreply.github.com>2024-01-13 08:02:52 -0500
committertdro <tdro@users.noreply.github.com>2024-01-13 08:02:52 -0500
commit76e5fdb122fd82276f06552df5c12e6af65a8506 (patch)
tree0a5ed0cf1a11520b2e794eef75764928ff46fe03
parenta54d720d0e2c81ae2375553418968f70a44be680 (diff)
downloaddotfiles-76e5fdb122fd82276f06552df5c12e6af65a8506.tar.gz
dotfiles-76e5fdb122fd82276f06552df5c12e6af65a8506.tar.bz2
dotfiles-76e5fdb122fd82276f06552df5c12e6af65a8506.zip
.vim/vimrc: Update snippets
-rw-r--r--.vim/snippets/package.nix27
-rw-r--r--.vim/snippets/shell.nix24
-rw-r--r--.vim/vimrc7
3 files changed, 46 insertions, 12 deletions
diff --git a/.vim/snippets/package.nix b/.vim/snippets/package.nix
new file mode 100644
index 0000000..31cb944
--- /dev/null
+++ b/.vim/snippets/package.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchgit }:
+
+stdenv.mkDerivation rec {
+ pname = "";
+ version = "";
+
+ src = fetchgit {
+ rev = version;
+ url = "";
+ sha256 = "";
+ };
+
+ dontBuild = true;
+
+ installPhase = ''
+ runHook preInstall
+ mkdir "$out"
+ runHook postInstall
+ '';
+
+ meta = {
+ homepage = "";
+ description = "";
+ license = lib.licenses.mit;
+ platforms = lib.platforms.linux;
+ };
+}
diff --git a/.vim/snippets/shell.nix b/.vim/snippets/shell.nix
index 6647b8c..2e58365 100644
--- a/.vim/snippets/shell.nix
+++ b/.vim/snippets/shell.nix
@@ -1,16 +1,22 @@
let
- name = "";
-
+ name = "nix-shell.pure";
pkgs = import <nixpkgs> { };
-in pkgs.mkShell {
+ 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;
-
- buildInputs = [ ];
-
- shellHook = ''
- export PS1='\h (${name}) \W \$ '
- '';
+ shellHook = "exec ${shell}/bin/${shell.name}";
}
diff --git a/.vim/vimrc b/.vim/vimrc
index b48b1d8..cb9b902 100644
--- a/.vim/vimrc
+++ b/.vim/vimrc
@@ -223,10 +223,11 @@ vnoremap <expr>y "my\"" . v:register . "y`y"
"------------------Snippets-------------------"
-nnoremap ,html :-1read $HOME/.vim/snippets/skeleton.html<cr>3jwf>a
-nnoremap ,nix-module :-1read $HOME/.vim/snippets/module.nix<cr>4jf"a
-nnoremap ,nix-shell :-1read $HOME/.vim/snippets/shell.nix<cr>2jf"a
nnoremap ,awk :-1read $HOME/.vim/snippets/skeleton.awk<cr>
+nnoremap ,nix-shell :-1read $HOME/.vim/snippets/shell.nix<cr>2jf"a
+nnoremap ,nix-module :-1read $HOME/.vim/snippets/module.nix<cr>4jf"a
+nnoremap ,nix-package :-1read $HOME/.vim/snippets/package.nix<cr>3jf"a
+nnoremap ,html :-1read $HOME/.vim/snippets/skeleton.html<cr>3jwf>a
"---------------Plugin Settings---------------"