diff --git a/host/configuration.nix b/host/configuration.nix index 9590fea..0b8f8c0 100644 --- a/host/configuration.nix +++ b/host/configuration.nix @@ -10,6 +10,7 @@ ./../nixosModules/gitea.nix ./../nixosModules/syncthing.nix ./../nixosModules/nextcloud.nix + ./../nixosModules/wakapi.nix ]; boot.loader.grub = { @@ -41,6 +42,7 @@ gitea.enable = true; syncthing.enable = true; nextcloud.enable = false; + wakapi.enable = true; # Automatically pull this config from git autoUpdate.enable = true; diff --git a/nixosModules/wakapi.nix b/nixosModules/wakapi.nix new file mode 100644 index 0000000..043dc2d --- /dev/null +++ b/nixosModules/wakapi.nix @@ -0,0 +1,36 @@ +{ pkgs, lib, config, ... }: { + + imports = [ + ./acme.nix + ]; + + options = { + wakapi.enable = lib.mkEnableOption "enables wakapi"; + }; + + config = lib.mkIf config.wakapi.enable { + + # Open http and https ports to the public + networking.firewall.allowedTCPPorts = [ 443 80 ]; + + # Make sure acme module is active for the "kyren.codes" ssl cert + acme.enable = true; + + services.nginx.enable = true; + services.nginx.virtualHosts."waka.kyren.codes" = { + useACMEHost = "kyren.codes"; + forceSSL = true; + locations."/".proxyPass = "http://localhost:3003/"; + }; + + services.wakapi.enable = true; + services.wakapi = { + database.createLocally = true; + passwordSalt = "dad8uadu8ad8a"; + settings = { + port = 3003; + public_url = "http://waka.kyren.codes:3003"; + }; + }; + }; +}