aboutsummaryrefslogtreecommitdiff
path: root/.config/vim/snippets/shell.nix
blob: 932c87e4a0cd414e39d5f36f997588c5be9e19fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 = "${shell}/bin/${shell.name}; exit";
}