From 4c6606be31a32463613fb99faa363e04c494423a Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Tue, 14 Jan 2025 23:12:25 -0600 Subject: [PATCH 1/2] bert: Add owntracks-recorder --- bert/configuration.nix | 1 + bert/services/http/index.nix | 1 + .../http/whereis.chandlerswift.com.nix | 9 +++++++++ bert/services/owntracks-recorder.nix | 19 +++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 bert/services/http/whereis.chandlerswift.com.nix create mode 100644 bert/services/owntracks-recorder.nix diff --git a/bert/configuration.nix b/bert/configuration.nix index e26c1ef..61f79b1 100644 --- a/bert/configuration.nix +++ b/bert/configuration.nix @@ -9,6 +9,7 @@ ./services/monitoring.nix ./services/forgejo.nix ./services/navidrome.nix + ./services/owntracks-recorder.nix ]; # Bootloader diff --git a/bert/services/http/index.nix b/bert/services/http/index.nix index b6cb723..d0fba6f 100644 --- a/bert/services/http/index.nix +++ b/bert/services/http/index.nix @@ -14,6 +14,7 @@ ./preview.chandlerswift.com.nix ./stjohnscccc.org.nix ./swiftgang.net.nix + ./whereis.chandlerswift.com.nix ]; services.caddy = { diff --git a/bert/services/http/whereis.chandlerswift.com.nix b/bert/services/http/whereis.chandlerswift.com.nix new file mode 100644 index 0000000..f561c3f --- /dev/null +++ b/bert/services/http/whereis.chandlerswift.com.nix @@ -0,0 +1,9 @@ +{config, ...}: { + services.caddy.virtualHosts."whereis.chandlerswift.com".extraConfig = '' + reverse_proxy localhost:8083 + + handle_errors { + respond "{err.status_code} {err.status_text}" + } + ''; +} diff --git a/bert/services/owntracks-recorder.nix b/bert/services/owntracks-recorder.nix new file mode 100644 index 0000000..ffe97b5 --- /dev/null +++ b/bert/services/owntracks-recorder.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: +let # off my branch until https://github.com/NixOS/nixpkgs/pull/373934 is merged + package = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/7ebad821473c78c7cfdf17ecf9f9be91d2455d81.tar.gz") {}).owntracks-recorder; +in +{ + systemd.services.owntracks-recorder = { + enable = true; + description = "owntracks-recorder Service"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + ExecStart = "${package}/bin/ot-recorder --storage /var/lib/owntracks --port 0"; + DynamicUser = true; + StateDirectory = "owntracks"; + StateDirectoryMode = "0775"; + WorkingDirectory = "/var/lib/owntracks"; + }; + }; +} From ccc8708a6be082a04f3aa45d3c33eb166e2a200e Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Tue, 14 Jan 2025 23:31:14 -0600 Subject: [PATCH 2/2] bert: Rename mount so systemd doesn't escape hyphen --- bert/configuration.nix | 2 +- bert/services/navidrome.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bert/configuration.nix b/bert/configuration.nix index 61f79b1..4072b87 100644 --- a/bert/configuration.nix +++ b/bert/configuration.nix @@ -37,7 +37,7 @@ boot.initrd.luks.devices."luks-48836129-1aa0-45c7-9fd1-6b053fa620b1".device = "/dev/disk/by-uuid/48836129-1aa0-45c7-9fd1-6b053fa620b1"; networking.hostName = "bert"; - fileSystems."/mnt/bigbird-public" = { + fileSystems."/mnt/bigbird_public" = { device = "//bigbird/public"; fsType = "cifs"; options = [ "guest" ]; diff --git a/bert/services/navidrome.nix b/bert/services/navidrome.nix index 42d86a6..7197ac5 100644 --- a/bert/services/navidrome.nix +++ b/bert/services/navidrome.nix @@ -2,7 +2,7 @@ services.navidrome = { enable = true; settings = { - MusicFolder = "/mnt/bigbird-public/media/music"; + MusicFolder = "/mnt/bigbird_public/media/music"; ScanSchedule = "@every 12h"; EnableSharing = true; };