This commit is contained in:
2025-10-12 03:49:44 -06:00
parent 651932d786
commit a1d910f999
13 changed files with 144 additions and 13 deletions

View File

@@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
let cfg = config.sydnix.deertopia.anki;
in {
options.sydnix.deertopia.anki = {
enable = lib.mkEnableOption "Anki";
};
config = lib.mkIf cfg.enable {
sydnix.impermanence.directories = [
"/var/lib/private/anki-sync-server"
];
sydnix.sops.secrets.anki-password.mode = "0600";
sydnix.deertopia.nginx.vhosts."anki" = {
directory = null;
vhost = {
forceSSL = true;
enableACME = true;
locations."/".extraConfig =
let port = builtins.toString config.services.anki-sync-server.port;
in ''
proxy_pass http://127.0.0.1:${port}/;
'';
};
};
services.anki-sync-server = {
enable = true;
address = "0.0.0.0";
openFirewall = true;
users = [
{
username = "msyds";
passwordFile = config.sops.secrets.anki-password.path;
}
];
};
};
}