about summary refs log tree commit diff
path: root/pkgs/tools/nix/info/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/nix/info/default.nix')
-rw-r--r--pkgs/tools/nix/info/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/tools/nix/info/default.nix b/pkgs/tools/nix/info/default.nix
new file mode 100644
index 000000000000..756478dccb77
--- /dev/null
+++ b/pkgs/tools/nix/info/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, coreutils, findutils, gnugrep, darwin, shellcheck }:
+stdenv.mkDerivation {
+  name = "nix-info";
+  src = ./info.sh;
+
+  buildInputs = [
+    shellcheck
+  ];
+
+  path = lib.makeBinPath ([
+    coreutils findutils gnugrep
+  ] ++ (if stdenv.isDarwin then [ darwin.DarwinTools ] else []));
+  is_darwin = if stdenv.isDarwin then "yes" else "no";
+
+  sandboxtest = ./sandbox.nix;
+  relaxedsandboxtest = ./relaxedsandbox.nix;
+  multiusertest = ./multiuser.nix;
+
+  unpackCmd = ''
+    mkdir nix-info
+    cp $src ./nix-info/nix-info
+  '';
+
+  buildPhase  = ''
+    substituteAllInPlace ./nix-info
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    shellcheck ./nix-info
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ./nix-info $out/bin/nix-info
+  '';
+}