about summary refs log tree commit diff
path: root/tools/nixery/popcount
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-02-25T18·40-0800
committerVincent Ambo <mail@tazj.in>2020-02-26T08·31+0000
commit215df37187501523bb3bf348b7bbd76a01692f19 (patch)
treee74b8e17e9e577121fdae38881449beb9f66b279 /tools/nixery/popcount
parent1031d890ec2b9a0a4d965eddc304bc5bf580442d (diff)
fix(popcount): Fix nix-build -A nixery-popcount
Previously, this was failing as follows:

```
these derivations will be built:
  /nix/store/7rbrf06phkiyz31dwpq88x920zjhnw0c-nixery-popcount.drv
building '/nix/store/7rbrf06phkiyz31dwpq88x920zjhnw0c-nixery-popcount.drv'...
building
warning: GOPATH set to GOROOT (/nix/store/4859cp1v7zqcqh43jkqsayl4wrz3g6hp-go-1.13.4/share/go) has no effect
failed to initialize build cache at /homeless-shelter/.cache/go-build: mkdir /homeless-shelter: permission denied
builder for '/nix/store/7rbrf06phkiyz31dwpq88x920zjhnw0c-nixery-popcount.drv' failed with exit code 1
error: build of '/nix/store/7rbrf06phkiyz31dwpq88x920zjhnw0c-nixery-popcount.drv' failed
```
Diffstat (limited to 'tools/nixery/popcount')
-rw-r--r--tools/nixery/popcount/default.nix14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/nixery/popcount/default.nix b/tools/nixery/popcount/default.nix
index 4a3c8faf9c..bd695380cf 100644
--- a/tools/nixery/popcount/default.nix
+++ b/tools/nixery/popcount/default.nix
@@ -12,15 +12,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{ go, stdenv }:
+{ buildGoPackage }:
 
-stdenv.mkDerivation {
+buildGoPackage {
   name = "nixery-popcount";
 
-  buildInputs = [ go ];
-  phases = [ "buildPhase" ];
-  buildPhase = ''
-    mkdir -p $out/bin
-    go build -o $out/bin/popcount ${./popcount.go}
-  '';
+  src = ./.;
+
+  goPackagePath = "github.com/google/nixery/popcount";
+  doCheck = true;
 }