about summary refs log tree commit diff stats
path: root/pkgs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-03 16:16:06 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-03 16:20:44 +0100
commit50d4c21a7f7d049448cebd483eda7109fafa4880 (patch)
tree7882ec2313dc7b75b237f5c57b20a9617b650cae /pkgs
parentfix(modules/lf/colors): Remove unused hidden home files (diff)
downloadnixos-config-50d4c21a7f7d049448cebd483eda7109fafa4880.zip
fix(pkgs/river-start): Create a wrapper script for river to store logs
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/ri/river-start/package.nix14
-rwxr-xr-xpkgs/by-name/ri/river-start/river-start.sh10
2 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/by-name/ri/river-start/package.nix b/pkgs/by-name/ri/river-start/package.nix
new file mode 100644
index 00000000..ab986708
--- /dev/null
+++ b/pkgs/by-name/ri/river-start/package.nix
@@ -0,0 +1,14 @@
+{
+  writeShellApplication,
+  river,
+}:
+writeShellApplication {
+  name = "river-start";
+  text = builtins.readFile ./river-start.sh;
+  runtimeInputs = [
+    river
+  ];
+  meta = {
+    mainProgram = "river-start";
+  };
+}
diff --git a/pkgs/by-name/ri/river-start/river-start.sh b/pkgs/by-name/ri/river-start/river-start.sh
new file mode 100755
index 00000000..4587ff96
--- /dev/null
+++ b/pkgs/by-name/ri/river-start/river-start.sh
@@ -0,0 +1,10 @@
+#! /usr/bin/env sh
+
+# NOTE: Keep this in sync with the file from `base_init.sh` <2025-02-03>
+RIVER_LOG_FILE="$HOME/.local/share/river/log"
+
+[ -d "$(dirname "$RIVER_LOG_FILE")" ] || mkdir --parents "$(dirname "$RIVER_LOG_FILE")"
+
+exec river -log-level info >"$RIVER_LOG_FILE" 2>&1
+
+# vim: ft=sh