From 4571630db5a2b7e322502cdc50dd7e21b362475d Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 11 Oct 2023 19:12:57 +0200 Subject: [PATCH] fix: journalwatch config --- modules/journalwatch.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/journalwatch.nix b/modules/journalwatch.nix index 4b68c2b..51d9ece 100644 --- a/modules/journalwatch.nix +++ b/modules/journalwatch.nix @@ -21,9 +21,15 @@ # Manually execute journalwatch timer: # sudo systemctl start journalwatch.service + # View generated journalwatch config: + # cat "$(systemctl show -P FragmentPath journalwatch.service)" | grep XDG_CONFIG_HOME + # #=> /nix/store/vzfvp7kizycs6lnks6icmlw3h1x6p7la-journalwatch-config + # cat /nix/store/vzfvp7kizycs6lnks6icmlw3h1x6p7la-journalwatch-config/journalwatch/config + # cat /nix/store/vzfvp7kizycs6lnks6icmlw3h1x6p7la-journalwatch-config/journalwatch/patterns + # Find a message and view its details # journalctl -b -p5 -o json-pretty - # Then press "/" and enter a pattern, then press "Enter". + # Then press "/", enter a pattern and press "Enter". assertions = [{ assertion = config.services.opensmtpd.enable; @@ -45,7 +51,7 @@ # `filters` are always regular expressions. # All regular expressions have to match the full string! # - # TODO: A "\s" in the double-quoted string `match` is inserted as `s` in the generated config file! We have to use "\\s" to insert `\s`. + # TODO: To insert `\` in the generated configuration, we have to use "\\" in double-quoted strings. # TODO: A ''\s'' in the multiline string `filter` is inserted as `\s` in the generated config file. # filterBlocks = [ @@ -70,7 +76,7 @@ # Ignore any invocation of sudo. .* ''; - match = "_EXE = //nix/store/[a-z0-9]+-sudo-[0-9]+\.[0-9]+\.[0-9]+[a-z0-9]+/bin/sudo/"; + match = "_EXE = //nix/store/[a-z0-9]+-sudo-[0-9]+\\.[0-9]+\\.[0-9]+[a-z0-9]+/bin/sudo/"; } # @@ -92,7 +98,7 @@ filters = '' .* ''; - match = "CONTAINER_NAME = /(docker-compose-btp-proxy-1|nc_web_[^-_\\s]+|nginx_arch\.p1st\.de|recipe\.privacy1st\.de_nginx)/"; + match = "CONTAINER_NAME = /(docker-compose-btp-proxy-1|nc_web_[^-_\\s]+|nginx_arch\\.p1st\\.de|recipe\\.privacy1st\\.de_nginx)/"; } { # yodaNas # TODO: Open issue on GitHub https://github.com/nginx-proxy/nginx-proxy/issues/1256. Maybe set env variable RESOLVERS=1.1.1.1? @@ -135,10 +141,10 @@ \S+ \S+ \[notice\] [0-9]+#[0-9]+: start worker processes \S+ \S+ \[notice\] [0-9]+#[0-9]+: start worker process [0-9]+ ''; - match = "IMAGE_NAME = /nginx:\S+/"; + match = "IMAGE_NAME = /nginx:\\S+/"; } { # yodaNas - # TODO: logged IP is not the public one, but always 172.24.0.6 + # TODO: logged IP is not the public one, but always 172.24.0.6. filters = '' Could not yet connect with DB\. Retrying in 10s \.\.\. Nextcloud or one of the apps require upgrade - only a limited number of commands are available @@ -249,7 +255,7 @@ filters = '' .* ''; - match = "IMAGE_NAME = /(deluan/navidrome|ghcr\.io/dgtlmoon/changedetection\.io)/"; + match = "IMAGE_NAME = /(deluan/navidrome|ghcr\\.io/dgtlmoon/changedetection\\.io)/"; } # @@ -260,7 +266,7 @@ filters = '' .* ''; - match = "_SYSTEMD_UNIT = /(bluetooth\.service|cups\.service)/"; + match = "_SYSTEMD_UNIT = /(bluetooth\\.service|cups\\.service)/"; } { # yodaNas. TODO: This is maybe a bug. It occurs when deploying and switching to a NixOS config with colmena. filters = '' @@ -454,7 +460,7 @@ filters = '' .* ''; - match = "_SYSTEMD_USER_UNIT = /(org\.gnome\..+\.service|pipewire\.service|wireplumber\.service|app-gnome-org\.gnome\.Software-[0-9]+\.scope)/"; + match = "_SYSTEMD_USER_UNIT = /(org\\.gnome\\..+\\.service|pipewire\\.service|wireplumber\\.service|app-gnome-org\\.gnome\\.Software-[0-9]+\\.scope)/"; } ]; };