diff --git a/flake.lock b/flake.lock index 52e4698..db4dc83 100644 --- a/flake.lock +++ b/flake.lock @@ -1515,11 +1515,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1766923069, - "narHash": "sha256-RTW7ZlqnTue6o6yr2rzIT9MhfQPucDFnx4RgE7e4fNo=", + "lastModified": 1766957585, + "narHash": "sha256-nDybJRbEgvFI291/WX6cYiQ1eG2Owz87Lc0ALVcb2nI=", "owner": "kmein", "repo": "scripts", - "rev": "8c8acef0d204ebd606d240ea829478f664f588fd", + "rev": "047016aff810844e1f62ce3fc80a97fe0f6754fc", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index aca167d..309d216 100644 --- a/flake.nix +++ b/flake.nix @@ -255,6 +255,7 @@ # packaged from inputs agenix = agenix.packages.${prev.stdenv.hostPlatform.system}.default; + pun-sort-api = scripts.packages.${prev.stdenv.hostPlatform.system}.pun-sort-api; alarm = scripts.packages.${prev.stdenv.hostPlatform.system}.alarm; menstruation-telegram = menstruation-telegram.packages.${prev.stdenv.hostPlatform.system}.menstruation-telegram; diff --git a/systems/ful/configuration.nix b/systems/ful/configuration.nix index 896780f..440097c 100644 --- a/systems/ful/configuration.nix +++ b/systems/ful/configuration.nix @@ -8,6 +8,7 @@ imports = [ ./hardware-configuration.nix ./matomo.nix + ./pun-sort.nix ./radio.nix ./panoptikon.nix ./hledger.nix diff --git a/systems/ful/pun-sort.nix b/systems/ful/pun-sort.nix new file mode 100644 index 0000000..f1ae192 --- /dev/null +++ b/systems/ful/pun-sort.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + lib, + ... +}: +let + punPort = 9007; +in +{ + systemd.services.pun-sort = { + enable = true; + serviceConfig.Type = "simple"; + wantedBy = [ "multi-user.target" ]; + environment = { + PORT = toString punPort; + PATH = lib.mkForce (lib.makeBinPath [ pkgs.espeak-ng ]); + }; + serviceConfig.ExecStart = lib.getExe pkgs.pun-sort-api; + }; + + services.nginx.virtualHosts."pun-sort.kmein.de" = { + enableACME = true; + forceSSL = true; + locations = { + "/".proxyPass = "http://127.0.0.1:${toString punPort}/"; + }; + }; +}