diff --git a/WORKSPACE b/WORKSPACE index f5769863..95cecf99 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -25,21 +25,6 @@ http_archive( sha256 = "e46612e9bb0dae8745de6a0643be69e8665a03f63163ac6610c210e80d14c3e4", ) -# Load and setup Nixpkgs, if Nix is present on the build system. -http_archive( - name = "io_tweag_rules_nixpkgs", - strip_prefix = "rules_nixpkgs-dc24090573d74adcf38730422941fd69b87682c7", - urls = ["https://github.com/tweag/rules_nixpkgs/archive/dc24090573d74adcf38730422941fd69b87682c7.tar.gz"], - sha256 = "aca86baa64174478c57f74ed09d5c2313113abe94aa3af030486d1b14032d3ed", -) - -load("//third_party/nix:repository_rules.bzl", "hscloud_setup_nix") - -hscloud_setup_nix( - revision = "1179841f9a88b8a548f4b11d1a03aa25a790c379", - sha256 = "8b64041bfb9760de9e797c0a985a4830880c21732489f397e217d877edd9a990", -) - # Download Go/Gazelle rules http_archive( name = "io_bazel_rules_go", @@ -69,9 +54,9 @@ load("@rules_python//python:pip.bzl", "pip_repositories") pip_repositories() -load("@hscloud_pip_imports//:imports.bzl", "hscloud_pip3_import") +load("@rules_python//python:pip.bzl", "pip3_import") -hscloud_pip3_import( +pip3_import( name = "pydeps", requirements = "//third_party/py:requirements.txt", ) @@ -81,12 +66,8 @@ load("@pydeps//:requirements.bzl", "pip_install") pip_install() # Setup Go toolchain. -# This workspace is generated by hscloud_setup_nixpkgs. It will either call -# go_register_toolchains() to automagically get Go toolchains from the Internet -# or, if nix is present, instead setup a toolchain from nixpkgs. -load("@hscloud_go_toolchain//:imports.bzl", "hscloud_go_register_toolchains") - -hscloud_go_register_toolchains() +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains") +go_register_toolchains() # IMPORTANT: match protobuf version above with the one loaded by grpc http_archive( diff --git a/cluster/tools/BUILD b/cluster/tools/BUILD index 141fff7e..2526fd74 100644 --- a/cluster/tools/BUILD +++ b/cluster/tools/BUILD @@ -31,12 +31,6 @@ copy_go_binary( visibility = ["//visibility:public"], ) -sh_binary( - name = "nixops", - srcs = ["nixops.sh"], - data = ["@nixops//:bin", "//tools:secretstore"], -) - sh_binary( name = "rook-s3cmd-config", srcs = ["rook-s3cmd-config.sh"], diff --git a/third_party/nix/BUILD b/third_party/nix/BUILD deleted file mode 100644 index 12ae0faf..00000000 --- a/third_party/nix/BUILD +++ /dev/null @@ -1,29 +0,0 @@ -load("@rules_python//python:defs.bzl", "py_runtime_pair") - -# Python toolchain definition that uses //third_party/nix:python.nix (via -# external repository). - -py_runtime( - name = "py3_runtime", - interpreter = "@hscloud_nix_python3//:python3", - python_version = "PY3", -) - -py_runtime( - name = "py2_runtime", - interpreter = "@hscloud_nix_python2//:python2", - python_version = "PY2", -) - - -py_runtime_pair( - name = "py_runtime_pair", - py2_runtime = ":py2_runtime", - py3_runtime = ":py3_runtime", -) - -toolchain( - name = "py_toolchain", - toolchain = ":py_runtime_pair", - toolchain_type = "@rules_python//python:toolchain_type", -) diff --git a/third_party/nix/python.nix b/third_party/nix/python.nix deleted file mode 100644 index 563127ee..00000000 --- a/third_party/nix/python.nix +++ /dev/null @@ -1,46 +0,0 @@ -# This is a Python interpreter wrapper that's passed to pip3_import under -# NixOS. -# It allows us to build some pip wheels under NixOS that require special -# system libraries. This is quite hacky, it would be much better if we could -# somehow tell pip3_import that a given package needs to be built within a -# given environment. - -with import {}; - -let - # We use mkDerivation instead of writeScript or writeScriptBin as we need a - # derivation that both: - # - has a directory structure (for rules_nixpkgs to be able to use it) - # - has the Python interpreter directly in that structure and not in bin/, as - # rules_python's pip3_import interpreter_path requires a file target, and - # will not take an alias. Meanwhile, rules_nixpkgs only creates a BUILD file - # in the root path of the external repository (which is populated with a - # symlink tree from the nix derivation), so we can onlly directly reference - # file in the root of a Nix derivation. - generic = package: binary: stdenv.mkDerivation { - name = "${binary}-wrapper"; - version = "1.0"; - src = ./.; - unpackPhase = ""; - buildPhase = '' - mkdir -p $out - cat > $out/${binary} <