SNOWSTEAD DOCS Home Dashboard

Private caches

Only machines with a pull token can read a private cache. Use one for builds of code you don't want public.

Make a cache private

Choose Only machines with a pull token when you create the cache. You can switch an empty cache between public and private on its page, and the change applies everywhere within 30 seconds. Once a cache has paths, who can pull is fixed: to change it, create a new cache.

Your tier must include private caches. If your tier changes to one without them, existing private caches stay private and machines with a pull token still read them, but new pushes are refused. Snowstead assigns tiers manually during beta.

Give machines a pull token

Create a token under Tokens that can pull from the cache, then put it in a netrc file on each machine. Nix sends it as the password when it fetches from the cache:

/etc/nix/netrc
machine uzair.snowstead.com
login token
password <the pull token>

Point Nix at the file. For organization uzair and cache team, the read address is below. Public and private caches use the same URL shape; private reads require a token, not a /private/ prefix. The netrc machine is the organization's hostname, without a scheme or cache path:

configuration.nix
nix.settings = {
  substituters = [ "https://uzair.snowstead.com/team" ];
  trusted-public-keys = [ "<the key from your cache's page>" ];
  netrc-file = "/etc/nix/netrc";
};

Use your organization's actual hostname in both places. If its slug changes, update the substituter and netrc machine. CLI pushes use https://api.snowstead.com. Run snowstead login to approve CLI access in your browser.

Keep the netrc file readable only by root. If a machine is lost, revoke its token and it stops working within seconds: see Tokens.