diff --git a/default.nix b/default.nix index 6cabdbc..64a50d3 100644 --- a/default.nix +++ b/default.nix @@ -59,7 +59,28 @@ in rec { ''; }; - entrypoint = pkgs.callPackage ./entrypoint {}; + goBinaries = pkgs.buildGoModule { + pname = "isle-go-binaries"; + version = "unstable"; + + # If this seems pointless, that's because it is! buildGoModule doesn't like + # it if the src derivation's name ends in "-go". So this mkDerivation here + # only serves to give buildGoModule a src derivation with a name it likes. + src = pkgs.stdenv.mkDerivation { + name = "isle-go-src"; + src = ./go; + builder = builtins.toFile "builder.sh" '' + source $stdenv/setup + cp -r "$src" "$out" + ''; + }; + + vendorSha256 = "sha256-P1TXG0fG8/6n37LmM5ApYctqoZzJFlvFAO2Zl85SVvk="; + + subPackages = [ + "./cmd/entrypoint" + ]; + }; dnsmasq = (pkgs.callPackage ./nix/dnsmasq.nix { stdenv = pkgs.pkgsStatic.stdenv; @@ -104,7 +125,7 @@ in rec { nebula garage pkgs.minio-client - entrypoint + goBinaries ] ++ (if bootstrap != null then [ rootedBootstrap ] else []); }; diff --git a/entrypoint/default.nix b/entrypoint/default.nix deleted file mode 100644 index cdba966..0000000 --- a/entrypoint/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - - buildGoModule, - -}: buildGoModule { - - pname = "isle-entrypoint"; - version = "unstable"; - src = ./src; - vendorSha256 = "sha256-P1TXG0fG8/6n37LmM5ApYctqoZzJFlvFAO2Zl85SVvk="; - subPackages = [ - "cmd/entrypoint" - ]; -} diff --git a/entrypoint/src/admin/admin.go b/go/admin/admin.go similarity index 100% rename from entrypoint/src/admin/admin.go rename to go/admin/admin.go diff --git a/entrypoint/src/bootstrap/bootstrap.go b/go/bootstrap/bootstrap.go similarity index 100% rename from entrypoint/src/bootstrap/bootstrap.go rename to go/bootstrap/bootstrap.go diff --git a/entrypoint/src/bootstrap/garage.go b/go/bootstrap/garage.go similarity index 100% rename from entrypoint/src/bootstrap/garage.go rename to go/bootstrap/garage.go diff --git a/entrypoint/src/bootstrap/garage_global_bucket.go b/go/bootstrap/garage_global_bucket.go similarity index 100% rename from entrypoint/src/bootstrap/garage_global_bucket.go rename to go/bootstrap/garage_global_bucket.go diff --git a/entrypoint/src/bootstrap/hosts.go b/go/bootstrap/hosts.go similarity index 100% rename from entrypoint/src/bootstrap/hosts.go rename to go/bootstrap/hosts.go diff --git a/entrypoint/src/cmd/entrypoint/admin.go b/go/cmd/entrypoint/admin.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/admin.go rename to go/cmd/entrypoint/admin.go diff --git a/entrypoint/src/cmd/entrypoint/bootstrap_util.go b/go/cmd/entrypoint/bootstrap_util.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/bootstrap_util.go rename to go/cmd/entrypoint/bootstrap_util.go diff --git a/entrypoint/src/cmd/entrypoint/daemon.go b/go/cmd/entrypoint/daemon.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/daemon.go rename to go/cmd/entrypoint/daemon.go diff --git a/entrypoint/src/cmd/entrypoint/daemon_util.go b/go/cmd/entrypoint/daemon_util.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/daemon_util.go rename to go/cmd/entrypoint/daemon_util.go diff --git a/entrypoint/src/cmd/entrypoint/dnsmasq_util.go b/go/cmd/entrypoint/dnsmasq_util.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/dnsmasq_util.go rename to go/cmd/entrypoint/dnsmasq_util.go diff --git a/entrypoint/src/cmd/entrypoint/garage.go b/go/cmd/entrypoint/garage.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/garage.go rename to go/cmd/entrypoint/garage.go diff --git a/entrypoint/src/cmd/entrypoint/garage_util.go b/go/cmd/entrypoint/garage_util.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/garage_util.go rename to go/cmd/entrypoint/garage_util.go diff --git a/entrypoint/src/cmd/entrypoint/hosts.go b/go/cmd/entrypoint/hosts.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/hosts.go rename to go/cmd/entrypoint/hosts.go diff --git a/entrypoint/src/cmd/entrypoint/logger.go b/go/cmd/entrypoint/logger.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/logger.go rename to go/cmd/entrypoint/logger.go diff --git a/entrypoint/src/cmd/entrypoint/main.go b/go/cmd/entrypoint/main.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/main.go rename to go/cmd/entrypoint/main.go diff --git a/entrypoint/src/cmd/entrypoint/nebula_util.go b/go/cmd/entrypoint/nebula_util.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/nebula_util.go rename to go/cmd/entrypoint/nebula_util.go diff --git a/entrypoint/src/cmd/entrypoint/proc_lock.go b/go/cmd/entrypoint/proc_lock.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/proc_lock.go rename to go/cmd/entrypoint/proc_lock.go diff --git a/entrypoint/src/cmd/entrypoint/sub_cmd.go b/go/cmd/entrypoint/sub_cmd.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/sub_cmd.go rename to go/cmd/entrypoint/sub_cmd.go diff --git a/entrypoint/src/cmd/entrypoint/version.go b/go/cmd/entrypoint/version.go similarity index 100% rename from entrypoint/src/cmd/entrypoint/version.go rename to go/cmd/entrypoint/version.go diff --git a/entrypoint/src/daemon/config.go b/go/daemon/config.go similarity index 100% rename from entrypoint/src/daemon/config.go rename to go/daemon/config.go diff --git a/entrypoint/src/daemon/daemon.go b/go/daemon/daemon.go similarity index 100% rename from entrypoint/src/daemon/daemon.go rename to go/daemon/daemon.go diff --git a/entrypoint/src/dnsmasq/dnsmasq.go b/go/dnsmasq/dnsmasq.go similarity index 100% rename from entrypoint/src/dnsmasq/dnsmasq.go rename to go/dnsmasq/dnsmasq.go diff --git a/entrypoint/src/dnsmasq/tpl.go b/go/dnsmasq/tpl.go similarity index 100% rename from entrypoint/src/dnsmasq/tpl.go rename to go/dnsmasq/tpl.go diff --git a/entrypoint/src/garage/admin_client.go b/go/garage/admin_client.go similarity index 100% rename from entrypoint/src/garage/admin_client.go rename to go/garage/admin_client.go diff --git a/entrypoint/src/garage/client.go b/go/garage/client.go similarity index 100% rename from entrypoint/src/garage/client.go rename to go/garage/client.go diff --git a/entrypoint/src/garage/garage.go b/go/garage/garage.go similarity index 100% rename from entrypoint/src/garage/garage.go rename to go/garage/garage.go diff --git a/entrypoint/src/garage/peer.go b/go/garage/peer.go similarity index 100% rename from entrypoint/src/garage/peer.go rename to go/garage/peer.go diff --git a/entrypoint/src/garage/tpl.go b/go/garage/tpl.go similarity index 100% rename from entrypoint/src/garage/tpl.go rename to go/garage/tpl.go diff --git a/entrypoint/src/go.mod b/go/go.mod similarity index 100% rename from entrypoint/src/go.mod rename to go/go.mod diff --git a/entrypoint/src/go.sum b/go/go.sum similarity index 100% rename from entrypoint/src/go.sum rename to go/go.sum diff --git a/entrypoint/src/nebula/nebula.go b/go/nebula/nebula.go similarity index 100% rename from entrypoint/src/nebula/nebula.go rename to go/nebula/nebula.go diff --git a/entrypoint/src/nebula/nebula_test.go b/go/nebula/nebula_test.go similarity index 100% rename from entrypoint/src/nebula/nebula_test.go rename to go/nebula/nebula_test.go diff --git a/entrypoint/src/yamlutil/yamlutil.go b/go/yamlutil/yamlutil.go similarity index 100% rename from entrypoint/src/yamlutil/yamlutil.go rename to go/yamlutil/yamlutil.go