diff options
-rw-r--r-- | .vim/snippets/package.nix | 27 | ||||
-rw-r--r-- | .vim/snippets/shell.nix | 24 | ||||
-rw-r--r-- | .vim/vimrc | 7 |
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}"; } @@ -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---------------" |