summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--default.nix2
-rw-r--r--pkgs/persistent-nix-shell/default.nix20
-rw-r--r--web/tree/info.md1
3 files changed, 23 insertions, 0 deletions
diff --git a/default.nix b/default.nix
index 1552309..0e44786 100644
--- a/default.nix
+++ b/default.nix
@@ -15,5 +15,7 @@ let
build-xslt = callPackage ./pkgs/xslt/build-xslt { };
static-xslt = callPackage ./pkgs/xslt/static-xslt { };
make-xslt = callPackage ./pkgs/xslt/make-xslt { };
+
+ persistent-nix-shell = callPackage ./pkgs/persistent-nix-shell { };
};
in custom
diff --git a/pkgs/persistent-nix-shell/default.nix b/pkgs/persistent-nix-shell/default.nix
new file mode 100644
index 0000000..8a74eb4
--- /dev/null
+++ b/pkgs/persistent-nix-shell/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, pkgs, ... }:
+
+pkgs.writeTextFile {
+ name = "persistent-nix-shell";
+ executable = true;
+ destination = "/bin/persistent-nix-shell";
+
+ text = ''
+ #!/bin/sh -eu
+
+ mkdir -p .gcroots
+
+ nix-instantiate shell.nix --indirect --add-root $PWD/.gcroots/shell.drv > /dev/null
+ nix-store -r $(nix-store --query --references $PWD/.gcroots/shell.drv) --indirect --add-root $PWD/.gcroots/shell.dep > /dev/null
+
+ # Fix to prevent implicit interactiveBash dependency
+ export NIX_BUILD_SHELL=/run/current-system/sw/bin/bash
+ exec nix-shell $(readlink $PWD/.gcroots/shell.drv) "$@"
+ '';
+}
diff --git a/web/tree/info.md b/web/tree/info.md
index cd1d773..1f95af9 100644
--- a/web/tree/info.md
+++ b/web/tree/info.md
@@ -32,6 +32,7 @@ Projects of my own:
Configurations of my own:
* [custom-neovim](https://code.kummerlaender.eu/pkgs/tree/pkgs/custom-neovim)
+* [persistent-nix-shell](https://code.kummerlaender.eu/pkgs/tree/pkgs/persistent-nix-shell)
Projects neither of my own nor of my configuration: