about summary refs log tree commit diff stats
path: root/home-manager
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager')
-rw-r--r--home-manager/config/river/default.nix23
-rwxr-xr-xhome-manager/config/river/init7
2 files changed, 25 insertions, 5 deletions
diff --git a/home-manager/config/river/default.nix b/home-manager/config/river/default.nix
index d0de7f13..bd1c842c 100644
--- a/home-manager/config/river/default.nix
+++ b/home-manager/config/river/default.nix
@@ -1,9 +1,30 @@
 {
   config,
   pkgs,
+  sysLib,
   ...
 }: {
-  xdg.configFile."river/init".source = ./init;
+  xdg.configFile."river/init".source = sysLib.makeShellScriptWithLibrary {
+      name = "river_init";
+      script = ./init;
+      dependencies = builtins.attrValues {
+        # TODO inherit river_init_lesser
+        inherit
+          (pkgs)
+          river
+          glib # gnome lib
+          gammastep
+          wlr-randr
+          yambar
+          mako
+          swaybg
+          swayidle
+          alacritty
+          ;
+      };
+    }
+    + /bin/river_init;
+
   xdg.configFile."river/res".source = ./res;
 }
 # vim: ts=2
diff --git a/home-manager/config/river/init b/home-manager/config/river/init
index 4c49489a..2f14fcaa 100755
--- a/home-manager/config/river/init
+++ b/home-manager/config/river/init
@@ -1,11 +1,10 @@
-#!/bin/sh
+#!/usr/bin/env dash
 # shellcheck disable=SC2086
 # shellcheck source=/dev/null
-. ~/.local/lib/shell/lib
+. %SHELL_LIBRARY_PATH
 
 err_fail() {
-    "$@"
-    if [ $? -ne 0 ] ;then
+    if ! "$@";then
         printf "%s\n" "$@" >> ~/river_log
         exec ~/.config/river/res/safe_init
     fi