diff options
| -rw-r--r-- | configuration.nix | 1 | ||||
| -rw-r--r-- | modules/network/default.nix | 1 | ||||
| -rw-r--r-- | modules/notifications/default.nix | 27 | ||||
| -rw-r--r-- | notes.org | 8 | ||||
| -rw-r--r-- | settings.nix | 1 |
5 files changed, 33 insertions, 5 deletions
diff --git a/configuration.nix b/configuration.nix index ca5aaf8..8acda64 100644 --- a/configuration.nix +++ b/configuration.nix @@ -7,6 +7,7 @@ ./modules/media ./modules/dashboard ./modules/storage + ./modules/notifications ]; nixpkgs.config.allowUnfree = true; diff --git a/modules/network/default.nix b/modules/network/default.nix index 53e64b0..55a4c43 100644 --- a/modules/network/default.nix +++ b/modules/network/default.nix @@ -21,6 +21,7 @@ in "syncthing.local" = { inherit host; port = ports.syncthing; }; "lidarr.local" = { inherit host; port = ports.lidarr; }; "git.local" = { inherit host; port = 80; basePath = "/gitweb/"; }; + "ntfy.local" = { inherit host; port = ports.ntfy; }; }; }; diff --git a/modules/notifications/default.nix b/modules/notifications/default.nix new file mode 100644 index 0000000..87df67d --- /dev/null +++ b/modules/notifications/default.nix @@ -0,0 +1,27 @@ +{ lib, pkgs, ... }: +let + settings = import ../../settings.nix { inherit lib; }; + host = settings.network.host; + ports = settings.network.ports; + url = "http://${host}:${toString ports.ntfy}"; +in +{ + networking.firewall.allowedTCPPorts = [ ports.ntfy ]; + + services.ntfy-sh = { + enable = true; + settings = { + listen-http = ":${toString ports.ntfy}"; + base-url = url; + }; + }; + + environment.systemPackages = [ + (pkgs.writeShellScriptBin "push-ntfy" '' + set -eu; + topic="$1"; shift 1; + body="$1"; shift 1; + ${pkgs.ntfy-sh}/bin/ntfy pub "$@" "${url}/$topic" "$body" + '') + ]; +} @@ -1,16 +1,14 @@ ** Current -- [ ] Syncthing -- [ ] Jellyfin library for photos (shared/private) -- [ ] Jellyfin library for music? +- [ ] Library for shared photos (shared/private) +- [ ] Lidarr + jellyfin (after lidarr issue is fixed) ** Later - [ ] NAS -- [ ] [[https://ntfy.sh]] - [ ] Think of where to place the server - [ ] Make autoconnect via networkmanager work consistently (higher frequency) ** Maybe -- [ ] Git bare repos (pass/notes) +- [ ] Git bare repos - [ ] Auto-updating - [ ] Move mail? - [ ] Expose dns via dynamic dns [[https://www.duckdns.org/]]? diff --git a/settings.nix b/settings.nix index f1b7ebb..041e375 100644 --- a/settings.nix +++ b/settings.nix @@ -13,6 +13,7 @@ in lib.recursiveUpdate privateSettings rec { jellyfin = 8096; transmissionRPC = 9091; syncthing = 3141; + ntfy = 3142; }; exposeTransmissionRPC = false; }; |
