1 # Athens {#module-athens}
3 *Source:* {file}`modules/services/development/athens.nix`
5 *Upstream documentation:* <https://docs.gomods.io/>
7 [Athens](https://github.com/gomods/athens)
8 is a Go module datastore and proxy
10 The main goal of Athens is providing a Go proxy (`$GOPROXY`) in regions without access to `https://proxy.golang.org` or to
11 improve the speed of Go module downloads for CI/CD systems.
13 ## Configuring {#module-services-development-athens-configuring}
15 A complete list of options for the Athens module may be found
16 [here](#opt-services.athens.enable).
18 ## Basic usage for a caching proxy configuration {#opt-services-development-athens-caching-proxy}
20 A very basic configuration for Athens that acts as a caching and forwarding HTTP proxy is:
29 If you want to prevent Athens from writing to disk, you can instead configure it to cache modules only in memory:
35 storageType = "memory";
40 To use the local proxy in Go builds (outside of `nix`), you can set the proxy as environment variable:
44 environment.variables = {
45 GOPROXY = "http://localhost:3000";
50 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.
52 This can either be done via the nix-daemon systemd unit:
56 systemd.services.nix-daemon.environment.GOPROXY = "http://localhost:3000";
60 or via the [impure-env experimental feature](https://nix.dev/manual/nix/2.24/command-ref/conf-file#conf-impure-env):
64 nix.settings.experimental-features = [ "configurable-impure-env" ];
65 nix.settings.impure-env = "GOPROXY=http://localhost:3000";