If you don't use the binary cache, it might take hours to build stuff you could just download, already built by CI.
Add this to your system configuration:
{
nix.settings.extra-substituters = [
"https://nix-postgres-artifacts.s3.amazonaws.com"
];
nix.settings.extra-trusted-public-keys = [
"nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI="
];
}Switch to the new configuration:
sudo nixos-rebuild switch
# or
sudo nix-darwin switchIf you don't have an immutable system configuration, you'll need to edit the nix config manually.
Edit this file:
/etc/nix/nix.conf
Extend it with this:
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=Caution
DO NOT add anyone to trusted-users in /etc/nix/nix.conf as it grants root without password. Instead, add the binary cache to extra-substituters and extra-trusted-public-keys.
Restart the nix daemon to load the new config:
On macOS:
sudo launchctl stop org.nixos.nix-daemon
sudo launchctl start org.nixos.nix-daemonOn Linux (systemd):
sudo systemctl restart nix-daemon