From 93717bf1a9dc19ceaed6525d28fee70de53d54ef Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 15:42:51 +0300 Subject: [PATCH] feat(jeeves): add `anki-sync-server` module --- hosts/nixos/jeeves/anki.nix | 31 ++++++++++++++++++ hosts/nixos/jeeves/configuration.nix | 1 + secrets/home/jeeves/anki/reo101.age | 8 +++++ ...0557c68a559523792483734f7c-anki.reo101.age | Bin 0 -> 275 bytes 4 files changed, 40 insertions(+) create mode 100644 hosts/nixos/jeeves/anki.nix create mode 100644 secrets/home/jeeves/anki/reo101.age create mode 100644 secrets/rekeyed/jeeves/07da270557c68a559523792483734f7c-anki.reo101.age diff --git a/hosts/nixos/jeeves/anki.nix b/hosts/nixos/jeeves/anki.nix new file mode 100644 index 0000000..41d3b4f --- /dev/null +++ b/hosts/nixos/jeeves/anki.nix @@ -0,0 +1,31 @@ +{ inputs, lib, pkgs, config, ... }: + +{ + age.secrets."anki.reo101" = { + rekeyFile = "${inputs.self}/secrets/home/jeeves/anki/reo101.age"; + mode = "400"; + }; + + services.anki-sync-server = { + enable = true; + package = pkgs.anki-sync-server; + users = [ + { + username = "reo101"; + passwordFile = config.age.secrets."anki.reo101".path; + } + ]; + address = "0.0.0.0"; + port = 27701; + }; + + services.nginx = { + virtualHosts."anki.jeeves.local" = { + enableACME = false; + forceSSL = false; + locations."/" = { + proxyPass = "http://127.0.0.1:${builtins.toString config.services.anki-sync-server.port}"; + }; + }; + }; +} diff --git a/hosts/nixos/jeeves/configuration.nix b/hosts/nixos/jeeves/configuration.nix index df5e3c6..fa3e568 100644 --- a/hosts/nixos/jeeves/configuration.nix +++ b/hosts/nixos/jeeves/configuration.nix @@ -20,6 +20,7 @@ # ./nextcloud.nix ./paperless.nix ./podman.nix + ./anki.nix ]; # services.kanidm = { }; diff --git a/secrets/home/jeeves/anki/reo101.age b/secrets/home/jeeves/anki/reo101.age new file mode 100644 index 0000000..736029c --- /dev/null +++ b/secrets/home/jeeves/anki/reo101.age @@ -0,0 +1,8 @@ +age-encryption.org/v1 +-> X25519 jROnYoLUU52v0VQuZVBUlfa/U1+LxqaaHXJkWLqis1Q +tDZKi1bq3h08JOyobEZq7fqAbe/Pyf1YPQj3y9CY8cM +-> KWa-grease bQ\#u] +XzYchZjVfR7y1kZp2PmXyZXyrYqGwZd5iKPERhSdc+3Pd2qU1pxVNJEZcAwcwpyM +/+x8jADcUcWs9+MzgW0qHKzM4vcpLCE +--- 0znfnFvlzrqKXsKHkbH5K7fS+vLMSfEKc84Wm0hFVGg +=$ /ݜz˻P2yg# ?7Qcsq \ No newline at end of file diff --git a/secrets/rekeyed/jeeves/07da270557c68a559523792483734f7c-anki.reo101.age b/secrets/rekeyed/jeeves/07da270557c68a559523792483734f7c-anki.reo101.age new file mode 100644 index 0000000000000000000000000000000000000000..f7312c64ce2160e788eda767678a9a3bd57090e6 GIT binary patch literal 275 zcmYdHPt{G$OD?J`D9Oyv)5|YP*Do{V(zR14F3!+RO))YxHMCSH^UX`jNmp~{ zUf>ttQCb*Sq#YcR