Unverified Commit b4fda70c authored by Paul Meyer's avatar Paul Meyer Committed by GitHub
Browse files

nixos/athens: update docs (#354508)

parents b44b70f8 ed5d274d
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ If you want to prevent Athens from writing to disk, you can instead configure it
}
```

To use the local proxy in Go builds, you can set the proxy as environment variable:
To use the local proxy in Go builds (outside of `nix`), you can set the proxy as environment variable:

```nix
{
@@ -47,6 +47,21 @@ To use the local proxy in Go builds, you can set the proxy as environment variab
}
```

It is currently not possible to use the local proxy for builds done by the Nix daemon. This might be enabled
by experimental features, specifically [`configurable-impure-env`](https://nixos.org/manual/nix/unstable/contributing/experimental-features#xp-feature-configurable-impure-env),
in upcoming Nix versions.
To also use the local proxy for Go builds happening in `nix` (with `buildGoModule`), the nix daemon can be configured to pass the GOPROXY environment variable to the `goModules` fixed-output derivation.

This can either be done via the nix-daemon systemd unit:

```nix
{
  systemd.services.nix-daemon.environment.GOPROXY = "http://localhost:3000";
}
```

or via the [impure-env experimental feature](https://nix.dev/manual/nix/2.24/command-ref/conf-file#conf-impure-env):

```nix
{
  nix.settings.experimental-features = [ "configurable-impure-env" ];
  nix.settings.impure-env = "GOPROXY=http://localhost:3000";
}
```