From c9a024840b717d0f338c1c4c63fa0d70adeab354 Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Tue, 5 Nov 2024 12:48:30 +0100 Subject: [PATCH] changes --- .../modules/home-assistant/multimedia.nix | 56 ++++++++++ .../fw-new/modules/home-assistant/shelly.nix | 1 + hosts/fw.cloonar.com/modules/ddclient.nix | 1 + .../modules/home-assistant/default.nix | 1 + .../modules/home-assistant/locks.nix | 6 + .../modules/home-assistant/multimedia.nix | 61 +++++++++- .../modules/home-assistant/power-saving.nix | 47 ++++++++ .../modules/home-assistant/shelly.nix | 1 + .../modules/home-assistant/sleep.nix | 104 +++++++++++------- hosts/fw.cloonar.com/modules/unbound.nix | 1 + hosts/fw.cloonar.com/modules/web/matrix.nix | 23 +++- hosts/nb-new.cloonar.com/configuration.nix | 3 + .../nb-new.cloonar.com/modules/sway/foot.ini | 2 +- .../nb-new.cloonar.com/modules/sway/sway.conf | 5 +- .../nb-new.cloonar.com/modules/sway/sway.nix | 7 +- .../users/configs/project_history | 2 + hosts/nb-new.cloonar.com/users/dominik.nix | 4 +- hosts/web-arm/configuration.nix | 1 + hosts/web-arm/sites/cloonar.com.nix | 11 +- hosts/web-arm/sites/feeds.cloonar.com.nix | 34 ++++-- 20 files changed, 301 insertions(+), 70 deletions(-) create mode 100644 hosts/fw.cloonar.com/modules/home-assistant/power-saving.nix diff --git a/hosts/fw-new/modules/home-assistant/multimedia.nix b/hosts/fw-new/modules/home-assistant/multimedia.nix index 9e15384..891410a 100644 --- a/hosts/fw-new/modules/home-assistant/multimedia.nix +++ b/hosts/fw-new/modules/home-assistant/multimedia.nix @@ -63,6 +63,38 @@ sequence = [ { choose = [ + { + conditions = [ + { + condition = "state"; + entity_id = "switch.tv_switch"; + state = "off"; + } + ]; + sequence = [ + { + service = "switch.turn_on"; + target = { + entity_id = "switch.tv_switch"; + }; + } + { + delay = 10; + } + { + service = "remote.send_command"; + target = { + entity_id = "remote.rmproplus"; + }; + data = { + num_repeats = 1; + delay_secs = 0.4; + hold_secs = 0; + command = "b64:JgBOAJaSFREVNRU2FTUVERURFRAVERURFTUVNhU1FREVERUQFREVERUQFTYVNRURFREVEBURFTYVNRURFRAVNhU1FTYVNRUABfmWkhURFQANBQAAAAAAAAAAAAA="; + }; + } + ]; + } { conditions = [ { @@ -232,6 +264,13 @@ command = "b64:JgDaAAABKZMUERMSExITEhMSExETEhMSExITEhMSExETNxQ2ExITEhMSEzcTNxM3ExITEhM3ExITNxMSEhITEhM3EzcTEhM3EwAFyAABKJQUERMSEhITEhMSExITEhMSEhITEhMSExITNxM3ExITEhMREzcTNxQ3EhITEhM3ExITNxMSExITEhM3EzcTEhM3EwAFyAABKJQUERMSExETEhMSExITEhMSExETEhMSExITNxM3ExITEhMREzcTOBI4ExETEhM3ExITNxMSExITEhM3EzcTEhM3E5IGAA0FAAAAAAAAAAAAAAAAAAA="; }; } + # turn off tv switch + { + service = "switch.turn_off"; + target = { + entity_id = "switch.tv_switch"; + }; + } ]; }; "automation all_multimedia_on" = { @@ -305,6 +344,23 @@ action = [ { choose = [ + { + conditions = [ + { + condition = "state"; + entity_id = "switch.tv_switch"; + state = "off"; + } + ]; + sequence = [ + { + service = "script.turn_on"; + target = { + entity_id = "script.turn_on_tv"; + }; + } + ]; + } { conditions = [ { diff --git a/hosts/fw-new/modules/home-assistant/shelly.nix b/hosts/fw-new/modules/home-assistant/shelly.nix index a2ff1ee..0b4922d 100644 --- a/hosts/fw-new/modules/home-assistant/shelly.nix +++ b/hosts/fw-new/modules/home-assistant/shelly.nix @@ -22,6 +22,7 @@ let { name = "Hallway Circuit"; id = "shellypro3-c8f09e894448"; relay = "0"; } { name = "Bathroom Circuit"; id = "shellypro3-c8f09e894448"; relay = "1"; } { name = "Kitchen Circuit"; id = "shellypro3-c8f09e894448"; relay = "2"; } + { name = "TV Switch"; id = "shelly1pmminig3-34b7da8b64c8"; relay = "0"; } ]; in { services.home-assistant.extraComponents = [ diff --git a/hosts/fw.cloonar.com/modules/ddclient.nix b/hosts/fw.cloonar.com/modules/ddclient.nix index 3a3eb01..eb381de 100644 --- a/hosts/fw.cloonar.com/modules/ddclient.nix +++ b/hosts/fw.cloonar.com/modules/ddclient.nix @@ -14,6 +14,7 @@ "git.cloonar.com" "palworld.cloonar.com" "matrix.cloonar.com" + "element.cloonar.com" ]; }; diff --git a/hosts/fw.cloonar.com/modules/home-assistant/default.nix b/hosts/fw.cloonar.com/modules/home-assistant/default.nix index de2c89c..f7f7b14 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/default.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/default.nix @@ -87,6 +87,7 @@ in ./music.nix ./notify.nix ./pc.nix + ./power-saving.nix ./pushover.nix ./presense.nix ./roborock.nix diff --git a/hosts/fw.cloonar.com/modules/home-assistant/locks.nix b/hosts/fw.cloonar.com/modules/home-assistant/locks.nix index 36a9539..2378d51 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/locks.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/locks.nix @@ -16,6 +16,12 @@ to = "home"; }; action = [ + { + service = "script.turn_on"; + target = { + entity_id = "script.turn_on_circuits"; + }; + } { service = "lock.unlock"; target = { diff --git a/hosts/fw.cloonar.com/modules/home-assistant/multimedia.nix b/hosts/fw.cloonar.com/modules/home-assistant/multimedia.nix index c1a02c9..155fd1e 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/multimedia.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/multimedia.nix @@ -63,6 +63,38 @@ sequence = [ { choose = [ + { + conditions = [ + { + condition = "state"; + entity_id = "switch.tv_switch"; + state = "off"; + } + ]; + sequence = [ + { + service = "switch.turn_on"; + target = { + entity_id = "switch.tv_switch"; + }; + } + { + delay = 10; + } + { + service = "remote.send_command"; + target = { + entity_id = "remote.rmproplus"; + }; + data = { + num_repeats = 1; + delay_secs = 0.4; + hold_secs = 0; + command = "b64:JgBOAJaSFREVNRU2FTUVERURFRAVERURFTUVNhU1FREVERUQFREVERUQFTYVNRURFREVEBURFTYVNRURFRAVNhU1FTYVNRUABfmWkhURFQANBQAAAAAAAAAAAAA="; + }; + } + ]; + } { conditions = [ { @@ -232,6 +264,13 @@ command = "b64:JgDaAAABKZMUERMSExITEhMSExETEhMSExITEhMSExETNxQ2ExITEhMSEzcTNxM3ExITEhM3ExITNxMSEhITEhM3EzcTEhM3EwAFyAABKJQUERMSEhITEhMSExITEhMSEhITEhMSExITNxM3ExITEhMREzcTNxQ3EhITEhM3ExITNxMSExITEhM3EzcTEhM3EwAFyAABKJQUERMSExETEhMSExITEhMSExETEhMSExITNxM3ExITEhMREzcTOBI4ExETEhM3ExITNxMSExITEhM3EzcTEhM3E5IGAA0FAAAAAAAAAAAAAAAAAAA="; }; } + # turn off tv switch + { + service = "switch.turn_off"; + target = { + entity_id = "switch.tv_switch"; + }; + } ]; }; "automation all_multimedia_on" = { @@ -297,14 +336,26 @@ }; } ]; - condition = { - condition = "state"; - entity_id = "binary_sensor.multimedia_device_on"; - state = "on"; - }; action = [ { choose = [ + { + conditions = [ + { + condition = "state"; + entity_id = "switch.tv_switch"; + state = "off"; + } + ]; + sequence = [ + { + service = "script.turn_on"; + target = { + entity_id = "script.turn_on_tv"; + }; + } + ]; + } { conditions = [ { diff --git a/hosts/fw.cloonar.com/modules/home-assistant/power-saving.nix b/hosts/fw.cloonar.com/modules/home-assistant/power-saving.nix new file mode 100644 index 0000000..591b2e5 --- /dev/null +++ b/hosts/fw.cloonar.com/modules/home-assistant/power-saving.nix @@ -0,0 +1,47 @@ +{ + services.home-assistant.extraComponents = [ + "nuki" + ]; + + services.home-assistant.config = { + "automation power leave home" = { + alias = "leave house power"; + mode = "restart"; + trigger = { + platform = "state"; + entity_id = [ + "device_tracker.dominiks_iphone" + ]; + from = "home"; + to = "not_home"; + }; + action = [ + { + service = "script.turn_on"; + target = { + entity_id = "script.turn_off_circuits"; + }; + } + ]; + }; + "automation arrive home power" = { + alias = "arrive home power"; + trigger = { + platform = "state"; + entity_id = [ + "device_tracker.dominiks_iphone" + ]; + from = "not_home"; + to = "home"; + }; + action = [ + { + service = "script.turn_on"; + target = { + entity_id = "script.turn_on_circuits"; + }; + } + ]; + }; + }; +} diff --git a/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix b/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix index c5e27b6..e656d72 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix @@ -23,6 +23,7 @@ let { name = "Hallway Circuit"; id = "shellypro3-c8f09e894448"; relay = "0"; } { name = "Bathroom Circuit"; id = "shellypro3-c8f09e894448"; relay = "1"; } { name = "Kitchen Circuit"; id = "shellypro3-c8f09e894448"; relay = "2"; } + { name = "TV Switch"; id = "shelly1pmminig3-34b7da8b64c8"; relay = "0"; } ]; in { services.home-assistant.extraComponents = [ diff --git a/hosts/fw.cloonar.com/modules/home-assistant/sleep.nix b/hosts/fw.cloonar.com/modules/home-assistant/sleep.nix index 7cee414..0e5a708 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/sleep.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/sleep.nix @@ -15,26 +15,10 @@ delay = 1700; } { - service = "switch.turn_on"; - entity_id = "switch.78_8c_b5_fe_41_62_port_2_poe"; # livingroom - } - { - service = "switch.turn_on"; - entity_id = "switch.78_8c_b5_fe_41_62_port_3_poe"; # garden - } - { - delay = 10; - } - { - service = "switch.turn_on"; - entity_id = "switch.hallway_circuit"; - } - { - delay = 10; - } - { - service = "switch.turn_on"; - entity_id = "switch.bathroom_circuit"; + service = "script.turn_on"; + target = { + entity_id = "script.turn_on_circuits"; + }; } ]; }; @@ -63,28 +47,10 @@ conditions = [ "{{ trigger.event.data.click_type == \"long\" }}" ]; sequence = [ { - service = "light.turn_off"; - entity_id = "all"; - } - { - service = "switch.turn_off"; - entity_id = "switch.coffee"; - } - { - service = "switch.turn_off"; - entity_id = "switch.78_8c_b5_fe_41_62_port_2_poe"; - } - { - service = "switch.turn_off"; - entity_id = "switch.78_8c_b5_fe_41_62_port_3_poe"; - } - { - service = "switch.turn_off"; - entity_id = "switch.hallway_circuit"; - } - { - service = "switch.turn_off"; - entity_id = "switch.bathroom_circuit"; + service = "script.turn_on"; + target = { + entity_id = "script.turn_off_everything"; + }; } ]; } @@ -92,5 +58,59 @@ } ]; }; + script = { + turn_off_everything = { + sequence = [ + { + service = "light.turn_off"; + entity_id = "all"; + } + { + service = "switch.turn_off"; + entity_id = "switch.coffee"; + } + { + service = "switch.turn_off"; + entity_id = "switch.78_8c_b5_fe_41_62_port_2_poe"; + } + { + service = "switch.turn_off"; + entity_id = "switch.78_8c_b5_fe_41_62_port_3_poe"; + } + { + service = "switch.turn_off"; + entity_id = "switch.hallway_circuit"; + } + # TODO: needs to stay on because phone is not loading otherwise + # { + # service = "switch.turn_off"; + # entity_id = "switch.bathroom_circuit"; + # } + ]; + }; + turn_on_circuits = { + sequence = [ + { + service = "switch.turn_on"; + entity_id = "switch.bathroom_circuit"; + } + { + delay = 60; + } + { + service = "switch.turn_on"; + entity_id = "switch.hallway_circuit"; + } + { + service = "switch.turn_on"; + entity_id = "switch.78_8c_b5_fe_41_62_port_2_poe"; + } + { + service = "switch.turn_on"; + entity_id = "switch.78_8c_b5_fe_41_62_port_3_poe"; + } + ]; + }; + }; }; } diff --git a/hosts/fw.cloonar.com/modules/unbound.nix b/hosts/fw.cloonar.com/modules/unbound.nix index e766b67..2f9fe71 100644 --- a/hosts/fw.cloonar.com/modules/unbound.nix +++ b/hosts/fw.cloonar.com/modules/unbound.nix @@ -57,6 +57,7 @@ let "\"home-assistant.cloonar.com IN A 10.42.97.20\"" "\"web-02.cloonar.com IN A 10.42.97.5\"" "\"matrix.cloonar.com IN A 10.42.97.5\"" + "\"element.cloonar.com IN A 10.42.97.5\"" "\"support.cloonar.com IN A 10.42.97.5\"" "\"git.cloonar.com IN A 10.42.97.50\"" "\"sync.cloonar.com IN A 10.42.97.51\"" diff --git a/hosts/fw.cloonar.com/modules/web/matrix.nix b/hosts/fw.cloonar.com/modules/web/matrix.nix index d30020e..05e9ab5 100644 --- a/hosts/fw.cloonar.com/modules/web/matrix.nix +++ b/hosts/fw.cloonar.com/modules/web/matrix.nix @@ -2,7 +2,7 @@ let hostname = "matrix"; fqdn = "${hostname}.cloonar.com"; - baseUrl = "https://matrix.cloonar.com"; + baseUrl = "https://${fqdn}"; clientConfig."m.homeserver".base_url = baseUrl; serverConfig."m.server" = "${fqdn}:443"; mkWellKnown = data: '' @@ -25,6 +25,27 @@ in { } ]; }; + + services.nginx.virtualHosts."element.cloonar.com" = { + forceSSL = true; + enableACME = true; + acmeRoot = null; + root = pkgs.element-web.override { + conf = { + default_theme = "dark"; + default_server_config = { + "m.homeserver" = { + base_url = "https://matrix.cloonar.com"; + server_name = "cloonar.com"; + }; + }; + disable_custom_urls = true; + disable_3pid_login = true; + default_country_code = "AT"; + }; + }; + }; + services.postgresqlBackup.enable = true; services.postgresqlBackup.databases = [ "dendrite" ]; diff --git a/hosts/nb-new.cloonar.com/configuration.nix b/hosts/nb-new.cloonar.com/configuration.nix index 2913050..362890f 100644 --- a/hosts/nb-new.cloonar.com/configuration.nix +++ b/hosts/nb-new.cloonar.com/configuration.nix @@ -62,6 +62,9 @@ in { hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = true; + hardware.bluetooth.settings = { + General = { ControllerMode = "bredr"; }; + }; services.tlp = { enable = true; diff --git a/hosts/nb-new.cloonar.com/modules/sway/foot.ini b/hosts/nb-new.cloonar.com/modules/sway/foot.ini index fb137ca..8d7993e 100644 --- a/hosts/nb-new.cloonar.com/modules/sway/foot.ini +++ b/hosts/nb-new.cloonar.com/modules/sway/foot.ini @@ -20,7 +20,7 @@ # underline-offset= # underline-thickness= # box-drawings-uses-font-glyphs=no -dpi-aware=yes +# dpi-aware=yes # initial-window-size-pixels=700x500 # Or, # initial-window-size-chars= diff --git a/hosts/nb-new.cloonar.com/modules/sway/sway.conf b/hosts/nb-new.cloonar.com/modules/sway/sway.conf index e528dba..1c78640 100644 --- a/hosts/nb-new.cloonar.com/modules/sway/sway.conf +++ b/hosts/nb-new.cloonar.com/modules/sway/sway.conf @@ -288,9 +288,6 @@ gaps inner 12 gaps outer 0 # startup applications -exec_always { - gsettings set org.gnome.desktop.interface text-scaling-factor 1.5 -} exec /run/wrappers/bin/gnome-keyring-daemon --start --daemonize exec dbus-sway-environment exec configure-gtk @@ -314,7 +311,7 @@ exec 'sleep 2; swaymsg workspace "$ws8"; swaymsg layout tabbed' exec mako --default-timeout=5000 # wallpaper -output eDP-1 scale 1.5 scale_filter linear +output eDP-1 scale 2 scale_filter linear output eDP-1 bg #282a36 solid_color output eDP-1 bg ~/.wallpaper.png center output DP-4 bg #282a36 solid_color diff --git a/hosts/nb-new.cloonar.com/modules/sway/sway.nix b/hosts/nb-new.cloonar.com/modules/sway/sway.nix index 0c90368..cc26e77 100644 --- a/hosts/nb-new.cloonar.com/modules/sway/sway.nix +++ b/hosts/nb-new.cloonar.com/modules/sway/sway.nix @@ -38,7 +38,7 @@ in { imports = [ ./social.nix ./signal-work.nix - ./parsec.nix + # ./parsec.nix ./rustdesk.nix ./thunderbird.nix ]; @@ -92,7 +92,6 @@ in { # unstable.cura freecad openscad - orca-slicer (unstable.where-is-my-sddm-theme.override { themeConfig.General = { @@ -110,8 +109,6 @@ in { variants = ["qt5"]; }) - # kdePackages.neochat - dbus-sway-environment ddev-pin.ddev dracula-theme @@ -128,8 +125,10 @@ in { hunspell hunspellDicts.de_DE hunspellDicts.en_US + inkscape jmeter libreoffice + libsForQt5.qtgraphicaleffects mako mqttui moonlight-qt diff --git a/hosts/nb-new.cloonar.com/users/configs/project_history b/hosts/nb-new.cloonar.com/users/configs/project_history index 64d627f..8586aea 100644 --- a/hosts/nb-new.cloonar.com/users/configs/project_history +++ b/hosts/nb-new.cloonar.com/users/configs/project_history @@ -14,6 +14,7 @@ /home/dominik/projects/cloonar/amz/amz-frontend /home/dominik/projects/cloonar/hilgenberg-website /home/dominik/projects/cloonar/korean-skin.care +/home/dominik/projects/cloonar/soundscape-sync /home/dominik/projects/myhidden.life/myhidden.life-web /home/dominik/projects/socialgrow.tech/sgt-api /home/dominik/projects/epicenter.works/ewcampaign @@ -22,3 +23,4 @@ /home/dominik/projects/epicenter.works/epicenter-nixos /home/dominik/projects/epicenter.works/spenden.akvorrat.at /home/dominik/projects/epicenter.works/dearmep-website +/home/dominik/projects/epicenter.works/padexporter diff --git a/hosts/nb-new.cloonar.com/users/dominik.nix b/hosts/nb-new.cloonar.com/users/dominik.nix index 01d5d04..14d0db4 100644 --- a/hosts/nb-new.cloonar.com/users/dominik.nix +++ b/hosts/nb-new.cloonar.com/users/dominik.nix @@ -8,7 +8,7 @@ let "browser.theme.content-theme" = 0; "browser.theme.toolbar-theme" = 0; "calendar.alarms.showmissed" = false; - "mail.uidensity" = 2; + "mail.uidensity" = 1; "mail.inline_attachments" = false; "mail.folder.views.version" = 1; "calendar.list.sortOrder" = "cloonar-personal"; "calendar.ui.version" = 3; @@ -480,6 +480,7 @@ in git clone gitea@git.cloonar.com:hilgenberg/website.git ${persistHome}/projects/cloonar/hilgenberg-website 2>/dev/null git clone gitea@git.cloonar.com:Cloonar/korean-skin.care.git ${persistHome}/projects/cloonar/korean-skin.care 2>/dev/null git clone gitea@git.cloonar.com:myhidden.life/web.git ${persistHome}/projects/myhidden.life/myhidden.life-web 2>/dev/null + git clone gitea@git.cloonar.com:Cloonar/soundscape-sync.git ${persistHome}/projects/cloonar/soundscape-sync 2>/dev/null git clone gitea@git.cloonar.com:socialgrow.tech/sgt-api.git ${persistHome}/projects/socialgrow.tech/sgt-api 2>/dev/null @@ -491,6 +492,7 @@ in git clone git@gitlab.epicenter.works:epicenter.works/nixos.git ${persistHome}/projects/epicenter.works/epicenter-nixos 2>/dev/null git clone git@github.com:AKVorrat/spenden.akvorrat.at.git ${persistHome}/projects/epicenter.works/spenden.akvorrat.at 2>/dev/null git clone git@github.com:AKVorrat/dearmep-website.git ${persistHome}/projects/epicenter.works/dearmep-website 2>/dev/null + git clone git@github.com:AKVorrat/padexporter.git ${persistHome}/projects/epicenter.works/padexporter 2>/dev/null set -eu ''; diff --git a/hosts/web-arm/configuration.nix b/hosts/web-arm/configuration.nix index 6f6c704..7627419 100644 --- a/hosts/web-arm/configuration.nix +++ b/hosts/web-arm/configuration.nix @@ -74,6 +74,7 @@ boot.tmp.cleanOnBoot = true; zramSwap.enable = true; networking.hostName = "web-arm"; + networking.domain = "cloonar.com"; services.openssh.enable = true; users.users.root.openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN/2SAFm50kraB1fepAizox/QRXxB7WbqVbH+5OPalDT47VIJGNKOKhixQoqhABHxEoLxdf/C83wxlCVlPV9poLfDgVkA3Lyt5r3tSFQ6QjjOJAgchWamMsxxyGBedhKvhiEzcr/Lxytnoz3kjDG8fqQJwEpdqMmJoMUfyL2Rqp16u+FQ7d5aJtwO8EUqovhMaNO7rggjPpV/uMOg+tBxxmscliN7DLuP4EMTA/FwXVzcFNbOx3K9BdpMRAaSJt4SWcJO2cS2KHA5n/H+PQI7nz5KN3Yr/upJN5fROhi/SHvK39QOx12Pv7FCuWlc+oR68vLaoCKYhnkl3DnCfc7A7" diff --git a/hosts/web-arm/sites/cloonar.com.nix b/hosts/web-arm/sites/cloonar.com.nix index 27621de..66cf45d 100644 --- a/hosts/web-arm/sites/cloonar.com.nix +++ b/hosts/web-arm/sites/cloonar.com.nix @@ -1,7 +1,12 @@ { pkgs, lib, config, ... }: let - domain = "cloonar.com"; + domain = config.networking.domain; dataDir = "/var/www/${domain}"; + mkWellKnown = data: '' + default_type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON data}'; + ''; in { services.nginx.virtualHosts."${domain}" = { forceSSL = true; @@ -44,6 +49,10 @@ in { locations."~ [^/]\.php(/|$)".extraConfig = '' deny all; ''; + + # matrix + locations."= /.well-known/matrix/server".extraConfig = mkWellKnown { "m.server" = "matrix.cloonar.com:443"; }; + locations."= /.well-known/matrix/client".extraConfig = mkWellKnown { "m.homeserver".base_url = "https://matrix.cloonar.com"; }; }; users.users."${domain}" = { isNormalUser = true; diff --git a/hosts/web-arm/sites/feeds.cloonar.com.nix b/hosts/web-arm/sites/feeds.cloonar.com.nix index 2f6a5cd..1cdba44 100644 --- a/hosts/web-arm/sites/feeds.cloonar.com.nix +++ b/hosts/web-arm/sites/feeds.cloonar.com.nix @@ -37,18 +37,30 @@ in { error_page 404 /index.php; ''; - locations."/favicon.ico".extraConfig = '' - log_not_found off; - access_log off; - ''; - locations."/robots.txt".extraConfig = '' - access_log off; - log_not_found off; - ''; - locations."/".extraConfig = '' - try_files $uri $uri/ /index.php$is_args$args; - ''; + locations = { + "/favicon.ico".extraConfig = '' + log_not_found off; + access_log off; + ''; + "/robots.txt".extraConfig = '' + access_log off; + log_not_found off; + ''; + + "~ ^/[^/]+/".extraConfig = '' + try_files $uri $uri/index.php /index.php; + ''; + + # "/".extraConfig = '' + # try_files $uri $uri/index.php; + # ''; + # + # "~ /$".extraConfig = '' + # try_files $uri $uri/index.php /index.php; + # ''; + }; + phpPackage = pkgs.php82; }; }