diff --git a/nixos/modules/services/misc/confd.nix b/nixos/modules/services/misc/confd.nix index 98738b6497b..50532a8a16f 100644 --- a/nixos/modules/services/misc/confd.nix +++ b/nixos/modules/services/misc/confd.nix @@ -63,7 +63,7 @@ in { package = mkOption { description = "Confd package to use."; - default = pkgs.goPackages.confd; + default = pkgs.confd; type = types.package; }; }; diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index 6a1799dedc8..f987c4792e9 100644 --- a/nixos/modules/services/monitoring/grafana.nix +++ b/nixos/modules/services/monitoring/grafana.nix @@ -200,13 +200,13 @@ in { staticRootPath = mkOption { description = "Root path for static assets."; - default = "${cfg.package}/share/go/src/github.com/grafana/grafana/public"; + default = "${cfg.package.out}/share/go/src/github.com/grafana/grafana/public"; type = types.str; }; package = mkOption { description = "Package to use."; - default = pkgs.goPackages.grafana; + default = pkgs.grafana-backend; type = types.package; }; @@ -319,7 +319,7 @@ in { wantedBy = ["multi-user.target"]; after = ["networking.target"]; serviceConfig = { - ExecStart = "${cfg.package}/bin/grafana --config ${cfgFile} web"; + ExecStart = "${cfg.package-backend}/bin/grafana --config ${cfgFile} web"; WorkingDirectory = cfg.dataDir; User = "grafana"; }; diff --git a/nixos/modules/services/security/hologram.nix b/nixos/modules/services/security/hologram.nix index f9abf38942f..58f308df7a2 100644 --- a/nixos/modules/services/security/hologram.nix +++ b/nixos/modules/services/security/hologram.nix @@ -95,7 +95,7 @@ in { wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStart = "${pkgs.goPackages.hologram}/bin/hologram-server --debug --conf ${cfgFile}"; + ExecStart = "${pkgs.hologram}/bin/hologram-server --debug --conf ${cfgFile}"; }; }; }; diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix index 7842df6b58f..de4f0803c34 100644 --- a/pkgs/development/go-modules/generic/default.nix +++ b/pkgs/development/go-modules/generic/default.nix @@ -129,19 +129,17 @@ go.stdenv.mkDerivation ( runHook preInstall mkdir -p $out + pushd "$NIX_BUILD_TOP/go" + while read f; do + echo "$f" | grep -q '^./\(src\|pkg/[^/]*\)/${goPackagePath}' || continue + mkdir -p "$(dirname "$out/share/go/$f")" + cp "$NIX_BUILD_TOP/go/$f" "$out/share/go/$f" + done < <(find . -type f) + popd - if [ -z "$dontInstallSrc" ]; then - pushd "$NIX_BUILD_TOP/go" - while read f; do - echo "$f" | grep -q '^./\(src\|pkg/[^/]*\)/${goPackagePath}' || continue - mkdir -p "$(dirname "$out/share/go/$f")" - cp "$NIX_BUILD_TOP/go/$f" "$out/share/go/$f" - done < <(find . -type f) - popd - fi - + mkdir $bin dir="$NIX_BUILD_TOP/go/bin" - [ -e "$dir" ] && cp -r $dir $out + [ -e "$dir" ] && cp -r $dir $bin runHook postInstall ''; @@ -151,7 +149,7 @@ go.stdenv.mkDerivation ( cat $file ${removeExpr removeReferences} > $file.tmp mv $file.tmp $file chmod +x $file - done < <(find $out/bin -type f 2>/dev/null) + done < <(find $bin/bin -type f 2>/dev/null) ''; disallowedReferences = lib.optional (!allowGoReference) go @@ -161,6 +159,9 @@ go.stdenv.mkDerivation ( enableParallelBuilding = enableParallelBuilding; + # I prefer to call this dev but propagatedBuildInputs expects $out to exist + outputs = [ "out" "bin" ]; + meta = { # Add default meta information platforms = lib.platforms.all; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fe194bdc3f7..cb68599c9d9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -818,13 +818,13 @@ let clib = callPackage ../tools/package-management/clib { }; - consul = goPackages.consul; + consul = goPackages.consul.bin // { outputs = [ "bin" ]; }; consul-ui = callPackage ../servers/consul/ui.nix { }; - consul-alerts = goPackages.consul-alerts; + consul-alerts = goPackages.consul-alerts.bin // { outputs = [ "bin" ]; }; - consul-template = goPackages.consul-template; + consul-template = goPackages.consul-template.bin // { outputs = [ "bin" ]; }; corosync = callPackage ../servers/corosync { }; @@ -948,7 +948,7 @@ let mcrypt = callPackage ../tools/misc/mcrypt { }; - mongodb-tools = goPackages.mongo-tools; + mongodb-tools = goPackages.mongo-tools.bin // { outputs = [ "bin" ]; }; mstflint = callPackage ../tools/misc/mstflint { }; @@ -1701,7 +1701,8 @@ let gptfdisk = callPackage ../tools/system/gptfdisk { }; - grafana = callPackage ../development/tools/misc/grafana { }; + grafana-frontend = callPackage ../development/tools/misc/grafana { }; + grafana-backend = pkgs.goPackages.grafana.bin // { outputs = [ "bin" ]; }; grafx2 = callPackage ../applications/graphics/grafx2 {}; @@ -2153,7 +2154,7 @@ let lshw = callPackage ../tools/system/lshw { }; lxc = callPackage ../os-specific/linux/lxc { }; - lxd = goPackages.lxd; + lxd = goPackages.lxd.bin // { outputs = [ "bin" ]; }; lzip = callPackage ../tools/compression/lzip { }; @@ -4074,7 +4075,7 @@ let go-repo-root = callPackage ../development/tools/misc/go-repo-root { }; - gox = goPackages.gox; + gox = goPackages.gox.bin // { outputs = [ "bin" ]; }; gprolog = callPackage ../development/compilers/gprolog { }; @@ -8664,7 +8665,7 @@ let go = go_1_4; buildGoPackage = import ../development/go-modules/generic { go = go_1_4; - govers = go14Packages.govers; + govers = go14Packages.govers.bin; inherit parallel lib; }; overrides = (config.goPackageOverrides or (p: {})) pkgs; @@ -8674,7 +8675,7 @@ let go = go_1_5; buildGoPackage = import ../development/go-modules/generic { go = go_1_5; - govers = go15Packages.govers; + govers = go15Packages.govers.bin; inherit parallel lib; }; overrides = (config.goPackageOverrides or (p: {})) pkgs; @@ -8958,7 +8959,7 @@ let dovecot_pigeonhole = callPackage ../servers/mail/dovecot-pigeonhole { }; - etcd = goPackages.etcd; + etcd = goPackages.etcd.bin // { outputs = [ "bin" ]; }; ejabberd = callPackage ../servers/xmpp/ejabberd { erlang = erlangR16; @@ -8975,7 +8976,7 @@ let v8 = v8_3_24_10; }; - etcdctl = goPackages.etcd; + etcdctl = etcd; exim = callPackage ../servers/mail/exim { }; @@ -10084,7 +10085,7 @@ let gotags = callPackage ../development/tools/gotags { }; - golint = goPackages.lint; + golint = goPackages.lint.bin // { outputs = [ "bin" ]; }; godep = callPackage ../development/tools/godep { }; @@ -13668,6 +13669,8 @@ let chessdb = callPackage ../games/chessdb { }; + confd = pkgs.goPackages.conf.bin // { outputs = [ "bin" ]; }; + construoBase = lowPrio (callPackage ../games/construo { mesa = null; freeglut = null; @@ -14529,6 +14532,8 @@ let camlp5 = ocamlPackages.camlp5_strict; }; + hologram = pkgs.goPackages.bin // { outputs = [ "bin" ]; }; + isabelle = import ../applications/science/logic/isabelle { inherit (pkgs) stdenv fetchurl nettools perl polyml; inherit (pkgs.emacs24Packages) proofgeneral; @@ -15130,7 +15135,7 @@ let utf8proc = callPackage ../development/libraries/utf8proc { }; - vault = goPackages.vault; + vault = goPackages.vault.bin // { outputs = [ "bin" ]; }; vbam = callPackage ../misc/emulators/vbam { inherit (xlibs) libpthreadstubs; diff --git a/pkgs/top-level/go-packages.nix b/pkgs/top-level/go-packages.nix index b69f3fd26b8..c32d7c865d1 100644 --- a/pkgs/top-level/go-packages.nix +++ b/pkgs/top-level/go-packages.nix @@ -130,12 +130,12 @@ let preConfigure = '' # Make the builtin tools available here - mkdir -p $out/bin + mkdir -p $bin/bin eval $(go env | grep GOTOOLDIR) find $GOTOOLDIR -type f | while read x; do - ln -sv "$x" "$out/bin" + ln -sv "$x" "$binbin" done - export GOTOOLDIR=$out/bin + export GOTOOLDIR=$bin/bin ''; excludedPackages = "\\(" @@ -381,11 +381,11 @@ let }; consul = buildFromGitHub { - rev = "a6317f2fb2ba9d5ae695f7fa703cfb30a1c59af1"; - date = "2015-07-24"; + rev = "4adc0b5c660919e3f21c9a60f567fd872b9e3d1e"; + date = "2015-08-27"; owner = "hashicorp"; repo = "consul"; - sha256 = "0jixpl9yksasqx9rkidx8qmqc59m34kiibsqfsv56g87wzyp89rs"; + sha256 = "1h4hbyr2c8yfmn5ijga5zx470mdplg231kbxbqfpvswrk69q89j3"; buildInputs = [ circbuf armon.go-metrics go-radix gomdb bolt consul-migrate go-checkpoint @@ -1326,7 +1326,6 @@ let repo = "lint"; sha256 = "1bj7zv534hyh87bp2vsbhp94qijc5nixb06li1dzfz9n0wcmlqw9"; excludedPackages = "testdata"; - dontInstallSrc = true; buildInputs = [ tools ]; }; @@ -1719,11 +1718,11 @@ let # Mongodb incorrectly names all of their binaries main # Let's work around this with our own installer installPhase = '' - mkdir -p $out/bin + mkdir -p $bin/bin while read b; do rm -f go/bin/main go install $goPackagePath/$b/main - cp go/bin/main $out/bin/$b + cp go/bin/main $bin/bin/$b done < <(find go/src/$goPackagePath -name main | xargs dirname | xargs basename -a) ''; };