diff options
author | Vincent Ambo <tazjin@google.com> | 2019-08-12T16·14+0100 |
---|---|---|
committer | Vincent Ambo <github@tazj.in> | 2019-08-13T23·02+0100 |
commit | 6d718bf2713a7e2209197247976390b878f51313 (patch) | |
tree | 6deaeb92468e17c8ea443523fd1a0043503d1066 /tools/nixery/server/main.go | |
parent | 819b4602788195cacde48cf8bb36ab242d240512 (diff) |
refactor(server): Use wrapper script to avoid path dependency
Instead of requiring the server component to be made aware of the location of the Nix builder via environment variables, this commit introduces a wrapper script for the builder that can simply exist on the builders $PATH. This is one step towards a slightly nicer out-of-the-box experience when using `nix-build -A nixery-bin`.
Diffstat (limited to 'tools/nixery/server/main.go')
-rw-r--r-- | tools/nixery/server/main.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/nixery/server/main.go b/tools/nixery/server/main.go index d20ede2eb587..3e015e8587fc 100644 --- a/tools/nixery/server/main.go +++ b/tools/nixery/server/main.go @@ -123,7 +123,6 @@ func signingOptsFromEnv() *storage.SignedURLOptions { type config struct { bucket string // GCS bucket to cache & serve layers signing *storage.SignedURLOptions // Signing options to use for GCS URLs - builder string // Nix derivation for building images port string // Port on which to launch HTTP server pkgs *pkgSource // Source for Nix package set } @@ -208,16 +207,14 @@ func buildImage(ctx *context.Context, cfg *config, image *image, bucket *storage } args := []string{ - "--no-out-link", - "--show-trace", "--argstr", "name", image.name, - "--argstr", "packages", string(packages), cfg.builder, + "--argstr", "packages", string(packages), } if cfg.pkgs != nil { args = append(args, "--argstr", "pkgSource", cfg.pkgs.renderSource(image.tag)) } - cmd := exec.Command("nix-build", args...) + cmd := exec.Command("nixery-build-image", args...) outpipe, err := cmd.StdoutPipe() if err != nil { @@ -466,7 +463,6 @@ func getConfig(key, desc string) string { func main() { cfg := &config{ bucket: getConfig("BUCKET", "GCS bucket for layer storage"), - builder: getConfig("NIX_BUILDER", "Nix image builder code"), port: getConfig("PORT", "HTTP port"), pkgs: pkgSourceFromEnv(), signing: signingOptsFromEnv(), |