about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2020-05-24 08:08:59 +0100
committerGitHub <noreply@github.com>2020-05-24 08:08:59 +0100
commit9df4eba48bf1c7a26af280790577ce731c36ca1b (patch)
treefc1155794b5c3da968c921ebe527d99fc0963649 /pkgs
parente4cd1ba5b8fc72dca67955f8ced74a17de397969 (diff)
parentf2a77c764d0b93c7def129ff0504177110f5b950 (diff)
downloadnixlib-9df4eba48bf1c7a26af280790577ce731c36ca1b.tar
nixlib-9df4eba48bf1c7a26af280790577ce731c36ca1b.tar.gz
nixlib-9df4eba48bf1c7a26af280790577ce731c36ca1b.tar.bz2
nixlib-9df4eba48bf1c7a26af280790577ce731c36ca1b.tar.lz
nixlib-9df4eba48bf1c7a26af280790577ce731c36ca1b.tar.xz
nixlib-9df4eba48bf1c7a26af280790577ce731c36ca1b.tar.zst
nixlib-9df4eba48bf1c7a26af280790577ce731c36ca1b.zip
Merge pull request #85673 from Mic92/nixos-shell
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/virtualization/nixos-shell/default.nix30
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/tools/virtualization/nixos-shell/default.nix b/pkgs/tools/virtualization/nixos-shell/default.nix
new file mode 100644
index 000000000000..0c6d7e7b9bb8
--- /dev/null
+++ b/pkgs/tools/virtualization/nixos-shell/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, nix, fetchFromGitHub, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "nixos-shell";
+  version = "0.1.1";
+
+  src = fetchFromGitHub {
+    owner = "Mic92";
+    repo = "nixos-shell";
+    rev = version;
+    sha256 = "1qk5a01vh6wbbkib8xr57w1j4l3n6xdjd46nsw9bsa444fzlc0wr";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postInstall = ''
+    wrapProgram $out/bin/nixos-shell \
+      --prefix PATH : ${stdenv.lib.makeBinPath [ nix ]}
+  '';
+
+  installFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = with stdenv.lib; {
+    description = "Spawns lightweight nixos vms in a shell";
+    inherit (src.meta) homepage;
+    license = licenses.mit;
+    maintainers = with maintainers; [ mic92 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c21090f1ba4d..7bd1772db838 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -20956,6 +20956,8 @@ in
     geoip = geoipWithDatabase;
   };
 
+  nixos-shell = callPackage ../tools/virtualization/nixos-shell {};
+
   node-problem-detector = callPackage ../applications/networking/cluster/node-problem-detector { };
 
   ninjas2 = callPackage ../applications/audio/ninjas2 {};