diff --git a/modules/services/adguard.nix b/modules/services/adguard.nix index 82c89c6..2be3c61 100644 --- a/modules/services/adguard.nix +++ b/modules/services/adguard.nix @@ -1,9 +1,25 @@ { config, pkgs, inputs, vars, ... }: -let - ip = vars.ipv4; - wireguardIp = vars.wireguardIp; +with lib; +let + cfg = config.custom.services.acme; in { + options.custom.services.acme = { + enable = mkEnableOption "Enables acme"; + ip = lib.mkOption { + type = types.str; + default = config.custom.static-ip.ip; + description = "this servers ipv4 address"; + }; + wireguardIp = lib.mkOption { + type = types.str; + description = "wireguard ipv4 address"; + }; + }; + config = let + ip = cfg.ip; + wireguardIp = cfg.wireguardIp; + in lib.mkIf cfg.enable { networking.firewall.allowedTCPPorts = [ 53 ]; networking.firewall.allowedUDPPorts = [ 53 ]; @@ -122,4 +138,5 @@ in }; }; }; +}; } diff --git a/modules/services/nginx.nix b/modules/services/nginx.nix index 73d8bfc..6c529e5 100644 --- a/modules/services/nginx.nix +++ b/modules/services/nginx.nix @@ -48,13 +48,14 @@ in virtualHosts = { "kopatz.ddns.net" = { - #serverAliases = [ + serverAliases = [ # "www.kopatz.ddns.net" # "server.home" # "server.home.arpa" # "192.168.0.6" - #]; - root = pkgs.hub; + "localhost" + ]; + root = pkgs.website; forceSSL = cfg.https; enableACME = cfg.https; quic = cfg.https; diff --git a/pkgs/default.nix b/pkgs/default.nix index fe2a32b..dcf23b7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,6 @@ -{pkgs, ...}: { +{pkgs, ...}: rec { tetrio = pkgs.callPackage ./tetrio-desktop/package.nix { }; hub = pkgs.callPackage ./hub/default.nix { }; + ente-frontend = pkgs.callPackage ./ente-frontend/default.nix { }; + website = pkgs.callPackage ./website/default.nix { inherit hub ente-frontend; }; } diff --git a/pkgs/ente-frontend/default.nix b/pkgs/ente-frontend/default.nix new file mode 100644 index 0000000..336872e --- /dev/null +++ b/pkgs/ente-frontend/default.nix @@ -0,0 +1,21 @@ +{ lib, buildNpmPackage, fetchFromGitHub }: + +buildNpmPackage rec { + pname = "ente-website"; + version = "1.0.0"; + + src = "${(fetchGit { + url = "git@github.com:oberprofis/ente.git"; + ref = "master"; + rev = "9a3545396fded13006fe804b2e75020ad65b9eaf"; + })}/website/tracker-site"; + npmDepsHash = "sha256-pNU7Y/73iltMSzGbQwUZWdD7GbIToXMFR5y763Bi50o="; + + # The prepack script runs the build script, which we'd rather do in the build phase. + npmPackFlags = [ "--ignore-scripts" ]; + installPhase = '' + mkdir -p $out + ls . + cp -r ./dist/tracker-site/* $out + ''; +} diff --git a/pkgs/website/default.nix b/pkgs/website/default.nix new file mode 100644 index 0000000..53930bb --- /dev/null +++ b/pkgs/website/default.nix @@ -0,0 +1,16 @@ +{ stdenv, lib, buildNpmPackage, fetchFromGitHub, hub, ente-frontend }: + +stdenv.mkDerivation (finalAttrs: { + pname = "kopatz-website"; + version = "1.0.0"; + + src = ./.; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/tracker-site + cp -r ${hub}/* $out + cp -r ${ente-frontend}/* $out/tracker-site + ''; +}) diff --git a/systems/vm/configuration.nix b/systems/vm/configuration.nix index e84dc17..a42c54a 100644 --- a/systems/vm/configuration.nix +++ b/systems/vm/configuration.nix @@ -20,7 +20,8 @@ lxqt.enable = true; }; services = { - kavita.enable = true; + nginx.enable = true; + nginx.https = false; }; }; }