Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Cleanup: hosts/binarycache configuration" #331

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion hosts/binarycache/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
self,
inputs,
lib,
config,
...
}:
{
sops.defaultSopsFile = ./secrets.yaml;
sops.secrets.cache-sig-key.owner = "root";

imports =
[
Expand All @@ -18,20 +20,54 @@
]
++ (with self.nixosModules; [
common
qemu-common
ficolo-common
service-openssh
service-binary-cache
service-nginx
user-jrautiola
user-cazfi
user-hrosten
user-mkaapu
user-avnik
]);

nix.settings = {
# we don't want the cache to be a substitutor for itself
substituters = lib.mkForce [ "https://cache.nixos.org/" ];
};

nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
networking.hostName = "binarycache";

networking = {
hostName = "binarycache";
};

security.acme = {
acceptTerms = true;
defaults.email = "[email protected]";
};

services.monitoring = {
metrics.enable = true;
logs.enable = true;
};

services.nginx = {
recommendedZstdSettings = true;
virtualHosts = {
"cache.vedenemo.dev" = {
enableACME = true;
forceSSL = true;
default = true;
locations."/" = {
proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
extraConfig = ''
zstd on;
zstd_types application/x-nix-archive;
'';
};
};
};
};
}
12 changes: 12 additions & 0 deletions services/binary-cache/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{ config, ... }:
{
services = {
harmonia = {
enable = true;
signKeyPath = config.sops.secrets.cache-sig-key.path;
};
};
networking.firewall.allowedTCPPorts = [ 5000 ];
}
Loading