diff --git a/pkgs/applications/networking/cluster/heptio-ark/default.nix b/pkgs/applications/networking/cluster/heptio-ark/default.nix index 21f4011f0706..aa86dcbeb241 100644 --- a/pkgs/applications/networking/cluster/heptio-ark/default.nix +++ b/pkgs/applications/networking/cluster/heptio-ark/default.nix @@ -13,7 +13,7 @@ buildGoPackage rec { sha256 = "18h9hvp95va0hyl268gnzciwy1dqmc57bpifbj885870rdfp0ffv"; }; - postInstall = "rm $bin/bin/issue-template-gen"; + excludedPackages = [ "issue-template-gen" ]; meta = with stdenv.lib; { description = "A utility for managing disaster recovery, specifically for your Kubernetes cluster resources and persistent volumes"; diff --git a/pkgs/applications/networking/cluster/openshift/default.nix b/pkgs/applications/networking/cluster/openshift/default.nix index a9b0ed3fcb59..bcd259b138f7 100644 --- a/pkgs/applications/networking/cluster/openshift/default.nix +++ b/pkgs/applications/networking/cluster/openshift/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchFromGitHub, buildGoPackage, which, go-bindata, rsync, utillinux -, coreutils, kerberos, clang +, coreutils, kerberos, clang, installShellFiles , components ? [ "cmd/oc" "cmd/openshift" @@ -35,7 +35,7 @@ in buildGoPackage rec { buildInputs = [ kerberos ]; - nativeBuildInputs = [ which rsync go-bindata clang ]; + nativeBuildInputs = [ which rsync go-bindata clang installShellFiles ]; patchPhase = '' patchShebangs ./hack @@ -74,8 +74,8 @@ in buildGoPackage rec { installPhase = '' mkdir -p $bin/bin cp -a "_output/local/bin/$(go env GOOS)/$(go env GOARCH)/"* "$bin/bin/" - install -D -t "$bin/etc/bash_completion.d" contrib/completions/bash/* - install -D -t "$bin/share/zsh/site-functions" contrib/completions/zsh/* + installShellCompletion --bash contrib/completions/bash/* + installShellCompletion --zsh contrib/completions/zsh/* ''; meta = with stdenv.lib; { diff --git a/pkgs/applications/version-management/git-lfs/1.nix b/pkgs/applications/version-management/git-lfs/1.nix index 0e0d75b0919c..5b2a9906a4f8 100644 --- a/pkgs/applications/version-management/git-lfs/1.nix +++ b/pkgs/applications/version-management/git-lfs/1.nix @@ -4,7 +4,7 @@ buildGoPackage rec { pname = "git-lfs"; version = "1.5.6"; rev = "0d02fb7d9a1c599bbf8c55e146e2845a908e04e0"; - + goPackagePath = "github.com/git-lfs/git-lfs"; src = fetchFromGitHub { @@ -14,8 +14,7 @@ buildGoPackage rec { sha256 = "0wddry1lqjccf4522fvhx6grx8h57xsz17lkaf5aybnrgw677w3d"; }; - # Tests fail with 'lfstest-gitserver.go:46: main redeclared in this block' - excludedPackages = [ "test" ]; + subPackages = [ "." ]; preBuild = '' pushd go/src/github.com/git-lfs/git-lfs @@ -23,9 +22,6 @@ buildGoPackage rec { popd ''; - postInstall = '' - rm -v $bin/bin/{man,script} - ''; meta = with stdenv.lib; { description = "Git extension for versioning large files"; homepage = "https://git-lfs.github.com/"; diff --git a/pkgs/development/tools/cloudfoundry-cli/default.nix b/pkgs/development/tools/cloudfoundry-cli/default.nix index ab746c9c530a..55d9854d7926 100644 --- a/pkgs/development/tools/cloudfoundry-cli/default.nix +++ b/pkgs/development/tools/cloudfoundry-cli/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildGoPackage, fetchFromGitHub }: +{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles }: buildGoPackage rec { pname = "cloudfoundry-cli"; @@ -15,6 +15,8 @@ buildGoPackage rec { sha256 = "0dqrkimwhw016icgyf4cyipzy6vdz5jgickm33xxd9018dh3ibwq"; }; + nativeBuildInputs = [ installShellFiles ]; + makeTarget = let hps = stdenv.hostPlatform.system; in if hps == "x86_64-darwin" then "out/cf-cli_osx" @@ -33,7 +35,7 @@ buildGoPackage rec { installPhase = '' install -Dm555 out/cf "$bin/bin/cf" - install -Dm444 -t "$bin/share/bash-completion/completions/" "$src/ci/installers/completion/cf" + installShellCompletion --bash "$src/ci/installers/completion/cf" ''; meta = with stdenv.lib; { diff --git a/pkgs/servers/blockbook/default.nix b/pkgs/servers/blockbook/default.nix index b931e8cfcb20..b6a1887bf807 100644 --- a/pkgs/servers/blockbook/default.nix +++ b/pkgs/servers/blockbook/default.nix @@ -39,9 +39,7 @@ buildGoPackage rec { packr clean && packr ''; - postInstall = '' - rm $bin/bin/{scripts,templates,trezor-common} - ''; + subPackages = [ "." ]; meta = with lib; { description = "Trezor address/account balance backend"; @@ -51,4 +49,3 @@ buildGoPackage rec { platforms = platforms.all; }; } - diff --git a/pkgs/servers/monitoring/prometheus/alertmanager.nix b/pkgs/servers/monitoring/prometheus/alertmanager.nix index de6d834c4d66..9074c19e1091 100644 --- a/pkgs/servers/monitoring/prometheus/alertmanager.nix +++ b/pkgs/servers/monitoring/prometheus/alertmanager.nix @@ -1,4 +1,4 @@ -{ stdenv, go, buildGoPackage, fetchFromGitHub }: +{ stdenv, go, buildGoPackage, fetchFromGitHub, installShellFiles }: buildGoPackage rec { pname = "alertmanager"; @@ -24,9 +24,11 @@ buildGoPackage rec { -X ${t}.GoVersion=${stdenv.lib.getVersion go} ''; + nativeBuildInputs = [ installShellFiles ]; + postInstall = '' - mkdir -p $bin/etc/bash_completion.d - $NIX_BUILD_TOP/go/bin/amtool --completion-script-bash > $bin/etc/bash_completion.d/amtool_completion.sh + $bin/bin/amtool --completion-script-bash > amtool.bash + installShellCompletion amtool.bash ''; meta = with stdenv.lib; { diff --git a/pkgs/tools/misc/aptly/default.nix b/pkgs/tools/misc/aptly/default.nix index c163fdad3a1e..792b12688aaf 100644 --- a/pkgs/tools/misc/aptly/default.nix +++ b/pkgs/tools/misc/aptly/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper, gnupg, bzip2, xz, graphviz }: +{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles, makeWrapper, gnupg, bzip2, xz, graphviz }: let @@ -29,11 +29,10 @@ buildGoPackage { goPackagePath = "github.com/aptly-dev/aptly"; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ installShellFiles makeWrapper ]; postInstall = '' - mkdir -p $bin/share/bash-completion/completions - ln -s ${aptlyCompletionSrc}/aptly $bin/share/bash-completion/completions + installShellCompletion --bash ${aptlyCompletionSrc}/aptly wrapProgram "$bin/bin/aptly" \ --prefix PATH ":" "${stdenv.lib.makeBinPath [ gnupg bzip2 xz graphviz ]}" '';