From 1e6b52a194a31374a08737a71bf78c00380c84f5 Mon Sep 17 00:00:00 2001 From: Sergiusz Bazanski Date: Wed, 15 May 2019 19:08:25 +0200 Subject: [PATCH] tools/: add nixops This now means we require Nix to be installed globally. This shouldn't be the case in the long run, but will be until https://github.com/tweag/rules_nixpkgs/issues/75 gets fixed or we maybe move from rules_nixpkgs to nix-bundle or something similar. --- README | 2 ++ WORKSPACE | 21 +++++++++++++++++++++ tools/BUILD | 6 ++++++ tools/install.sh | 3 ++- 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/README b/README index 641cd515..902b12c6 100644 --- a/README +++ b/README @@ -3,6 +3,8 @@ HSCloud This is a monorepo. You'll need bash and Bazel 0.20.0+ to use it. +You'll also need Nix installed globally in your system until [rules_nixpkgs/75](https://github.com/tweag/rules_nixpkgs/issues/75) is resolved. Or run on NixOS. + Getting started --------------- diff --git a/WORKSPACE b/WORKSPACE index 5ed4df00..c6bc0e1f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,6 +1,27 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +# Nix rules +http_archive( + name = "io_tweag_rules_nixpkgs", + strip_prefix = "rules_nixpkgs-364adc70f32c2b3982995fce06b334f4d159070e", + urls = ["https://github.com/tweag/rules_nixpkgs/archive/364adc70f32c2b3982995fce06b334f4d159070e.tar.gz"], +) + +# Nix packages + +load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package") +nixpkgs_git_repository( + name = "nixpkgs", + revision = "2f1f9a9fe8a3c22f0677733523eaf6bd33995d50", +) + +nixpkgs_package( + name = "nixops", + attribute_path = "nixops", + repositories = { "nixpkgs": "@nixpkgs" }, +) + # Python rules git_repository( name = "io_bazel_rules_python", diff --git a/tools/BUILD b/tools/BUILD index d80ad4db..80678ca4 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -55,3 +55,9 @@ copy_go_binary( src = "@com_github_cloudflare_cfssl//cmd/cfssl:cfssl", visibility = ["//visibility:public"], ) + +copy_go_binary( + name = "nixops", + src = "@nixops//:bin", + visibility = ["//visibility:public"], +) diff --git a/tools/install.sh b/tools/install.sh index 5d611e6f..4485f474 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -9,4 +9,5 @@ cd "${hscloud_root}" bazel build \ //tools:kubectl //tools:kubecfg //tools:secretstore \ - //tools:pass //tools:calicoctl.bin //tools:cfssl + //tools:pass //tools:calicoctl.bin //tools:cfssl \ + //tools:nixops