From f35bccf1ac7071a95b05cf19b879e985c44826cf Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Wed, 1 Jan 2025 13:46:50 +0200 Subject: [PATCH] Added wakapi, open source wakatime --- host/configuration.nix | 2 ++ nixosModules/wakapi.nix | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 nixosModules/wakapi.nix 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"; + }; + }; + }; +}