mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-09-10 12:50:05 +00:00
✨♻️ Migrate and refactor all v1 services, Add atticd service and cleanup
This commit is contained in:
parent
76489651f1
commit
e45cfc0fbc
24 changed files with 592 additions and 20 deletions
53
modules/nixos/services/atticd/default.nix
Normal file
53
modules/nixos/services/atticd/default.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
inherit (self) namespace;
|
||||
|
||||
cfg = config.${namespace}.services.atticd;
|
||||
in {
|
||||
options.${namespace}.services.atticd = {
|
||||
enable = mkEnableOption "the attic service, a multi-tenant nix binary cache.";
|
||||
sopsFile = mkOpt types.str null "The location of the sops secret file for the Atticd service.";
|
||||
sopsFormat = mkOpt types.str null "The format of the sops secret file for the Atticd service.";
|
||||
subdomain = mkOpt types.str "cache" "The subdomain, of the system domain, the service should be exposed on.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config.sops.secrets."services/atticd" = {
|
||||
sopsFile = cfg.sopsFile;
|
||||
format = cfg.sopsFormat;
|
||||
};
|
||||
|
||||
services.atticd = {
|
||||
enable = true;
|
||||
|
||||
environmentFile = config.sops.secrets."services/atticd".path;
|
||||
|
||||
settings = {
|
||||
listen = "[::]:3900";
|
||||
jwt = {};
|
||||
|
||||
chunking = {
|
||||
nar-size-threshold = 64 * 1024; # 64 KiB
|
||||
min-size = 16 * 1024; # 16 KiB
|
||||
avg-size = 64 * 1024; # 64 KiB
|
||||
max-size = 256 * 1024; # 256 KiB
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.traefik.dynamicConfigOptions = {
|
||||
http = {
|
||||
services.atticd.loadBalancer.server.url = "http://localhost:3900";
|
||||
routers.atticd = {
|
||||
entrypoints = ["websecure"];
|
||||
rule = "Host(`${cfg.subdomain}.${config.services.domain}`)";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue