harmonia: dedupe code with nixos-modules

This commit is contained in:
Sandro - 2024-01-11 21:46:10 +01:00
parent a2925001fa
commit 65bc6519ec
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
2 changed files with 4 additions and 18 deletions

View File

@ -34,6 +34,7 @@ If you want to have an additional backport, cherry-pick or other change, please
### nixos-modules repo ### nixos-modules repo
The nixos-modules repo lives at <https://github.com/supersandro2000/nixos-modules> and is mirrored to <https://gitea.c3d2.de/c3d2/nixos-modules>. The nixos-modules repo lives at <https://github.com/supersandro2000/nixos-modules> and is mirrored to <https://gitea.c3d2.de/c3d2/nixos-modules>.
Auto generated documentation about all options is available at <https://supersandro2000.github.io/nixos-modules/>.
It contains options sandro shares between his private nixos configs and the C3D2 one. It contains options sandro shares between his private nixos configs and the C3D2 one.
It sets many options by default and when searching for a particular setting you should always grep this repo, too. It sets many options by default and when searching for a particular setting you should always grep this repo, too.
In question ask sandro and consider improving the documentation about this with comments and readme explanations. In question ask sandro and consider improving the documentation about this with comments and readme explanations.

View File

@ -1,8 +1,5 @@
{ config, lib, libS, pkgs, ... }: { config, lib, libS, pkgs, ... }:
let
cachePort = 5000;
in
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
@ -155,15 +152,11 @@ in
''; '';
}; };
# A rust nix binary cache
harmonia = { harmonia = {
enable = true; enable = true;
settings = { domain = "nix-cache.hq.c3d2.de";
bind = "[::]:${toString cachePort}"; port = 5000;
workers = 20; settings.workers = 20;
max_connection_rate = 1024;
priority = 50;
};
signKeyPath = config.sops.secrets."nix/signing-key/secretKey".path; signKeyPath = config.sops.secrets."nix/signing-key/secretKey".path;
}; };
@ -182,14 +175,6 @@ in
"nix-cache.hq.c3d2.de" = { "nix-cache.hq.c3d2.de" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cachePort}";
extraConfig = ''
brotli off;
gzip off;
zstd off;
'';
};
}; };
}; };
}; };