ops/nixos: add GCP binary cache

This commit is contained in:
Luke Granger-Brown 2020-05-09 00:03:21 +01:00
parent 19c29c56ff
commit bc50bdb7d2
2 changed files with 10 additions and 3 deletions

View file

@ -19,6 +19,9 @@ let
exec sudo "$0" "$@"
fi
export AWS_ACCESS_KEY_ID="${depot.ops.secrets.nixCache.AWS_ACCESS_KEY_ID}"
export AWS_SECRET_ACCESS_KEY="${depot.ops.secrets.nixCache.AWS_SECRET_ACCESS_KEY}"
system="$(nix-build -E '(import <depot> {}).ops.nixos.${system}' --no-out-link)"
nix-env -p /nix/var/nix/profiles/system --set "$system"
"$system/bin/switch-to-configuration" switch

View file

@ -5,7 +5,13 @@ in
{
hardware.enableRedistributableFirmware = true;
nix.nixPath = [ "depot=/home/lukegb/depot/" "nixpkgs=/home/lukegb/depot/third_party/nixpkgs/" ];
nix = {
nixPath = [ "depot=/home/lukegb/depot/" "nixpkgs=/home/lukegb/depot/third_party/nixpkgs/" ];
trustedUsers = [ "root" "@wheel" ];
binaryCaches = lib.mkForce [ "https://hydra.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ];
trustedBinaryCaches = lib.mkForce [ "https://hydra.nixos.org/" "s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1" ];
};
nixpkgs.config = { allowUnfree = true; };
i18n.defaultLocale = "en_GB.UTF-8";
console.keyMap = "us";
@ -20,8 +26,6 @@ in
allowPing = true;
};
nixpkgs.config = { allowUnfree = true; };
users.mutableUsers = false;
users.users = let secrets = depot.ops.secrets; in {
root.hashedPassword = secrets.passwordHashes.root;