about summary refs log tree commit diff
path: root/pkgs/tools/security
diff options
context:
space:
mode:
authorJaka Hudoklin <jaka@x-truder.net>2019-08-04 12:20:16 +0200
committerJaka Hudoklin <jaka@x-truder.net>2019-08-04 12:20:16 +0200
commit558cdf0e11247f69585234e057deb22166e63793 (patch)
tree14440854b938639e737e7bc80661e4eef3ca12c6 /pkgs/tools/security
parentf403684eee39400d78158e713b56360eb4f0d884 (diff)
downloadnixlib-558cdf0e11247f69585234e057deb22166e63793.tar
nixlib-558cdf0e11247f69585234e057deb22166e63793.tar.gz
nixlib-558cdf0e11247f69585234e057deb22166e63793.tar.bz2
nixlib-558cdf0e11247f69585234e057deb22166e63793.tar.lz
nixlib-558cdf0e11247f69585234e057deb22166e63793.tar.xz
nixlib-558cdf0e11247f69585234e057deb22166e63793.tar.zst
nixlib-558cdf0e11247f69585234e057deb22166e63793.zip
vault-bin: use sourceRoot instead of custom unpackPhase
Diffstat (limited to 'pkgs/tools/security')
-rw-r--r--pkgs/tools/security/vault/vault-bin.nix42
1 files changed, 19 insertions, 23 deletions
diff --git a/pkgs/tools/security/vault/vault-bin.nix b/pkgs/tools/security/vault/vault-bin.nix
index 7befface3b5d..b58e41d850d8 100644
--- a/pkgs/tools/security/vault/vault-bin.nix
+++ b/pkgs/tools/security/vault/vault-bin.nix
@@ -1,12 +1,10 @@
 { stdenv, fetchurl, unzip }:
 
 let
-
   version = "1.1.3";
-  sources = let
 
+  sources = let
     base = "https://releases.hashicorp.com/vault/${version}";
-
   in {
     "x86_64-linux" = fetchurl {
       url = "${base}/vault_${version}_linux_amd64.zip";
@@ -30,28 +28,26 @@ let
     };
   };
 
-in
-  stdenv.mkDerivation {
+in stdenv.mkDerivation {
+  name = "vault-bin-${version}";
 
-    src = sources."${stdenv.hostPlatform.system}" or (throw "unsupported system: ${stdenv.hostPlatform.system}");
+  src = sources."${stdenv.hostPlatform.system}" or (throw "unsupported system: ${stdenv.hostPlatform.system}");
 
-    name = "vault-bin-${version}";
+  nativeBuildInputs = [ unzip ];
 
-    nativeBuildInputs = [ unzip ];
+  sourceRoot = ".";
 
-    unpackPhase = "unzip $src -d vault";
+  installPhase = ''
+    mkdir -p $out/bin $out/share/bash-completion/completions
+    mv vault $out/bin
+    echo "complete -C $out/bin/vault vault" > $out/share/bash-completion/completions/vault
+  '';
 
-    installPhase = ''
-      mkdir -p $out/bin $out/share/bash-completion/completions
-      mv vault/vault $out/bin
-      echo "complete -C $out/bin/vault vault" > $out/share/bash-completion/completions/vault
-    '';
-
-    meta = with stdenv.lib; {
-      homepage = https://www.vaultproject.io;
-      description = "A tool for managing secrets, this binary includes the UI";
-      platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "i686-darwin" ];
-      license = licenses.mpl20;
-      maintainers = with maintainers; [ offline psyanticy ];
-    };
-  }
\ No newline at end of file
+  meta = with stdenv.lib; {
+    homepage = https://www.vaultproject.io;
+    description = "A tool for managing secrets, this binary includes the UI";
+    platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "i686-darwin" ];
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ offline psyanticy ];
+  };
+}