about summary refs log tree commit diff stats
path: root/home-manager/soispha/wms/river/default.nix
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-01 15:31:42 +0200
committerSoispha <soispha@vhack.eu>2023-08-01 15:42:54 +0200
commit0a608bd781dcda40144097b007fac0a0c60a8ee1 (patch)
treee69fbc1fd0e15e3b86f31f47b776df21f6f0170d /home-manager/soispha/wms/river/default.nix
parentFix(hm/conf/gammastep): Use lighter settings on laptops (diff)
downloadnixos-config-0a608bd781dcda40144097b007fac0a0c60a8ee1.zip
Refactor(treewide): Move module configuration in separate files
Diffstat (limited to 'home-manager/soispha/wms/river/default.nix')
-rw-r--r--home-manager/soispha/wms/river/default.nix68
1 files changed, 68 insertions, 0 deletions
diff --git a/home-manager/soispha/wms/river/default.nix b/home-manager/soispha/wms/river/default.nix
new file mode 100644
index 00000000..43a47b1a
--- /dev/null
+++ b/home-manager/soispha/wms/river/default.nix
@@ -0,0 +1,68 @@
+{
+  pkgs,
+  sysLib,
+  river_init_lesser,
+  nixosConfig,
+  system,
+  ...
+}: let
+  inherit (nixosConfig.networking) hostName;
+  mappings =
+    if hostName == "tiamat"
+    then ''
+      err_fail riverctl keyboard-layout 'us'
+      err_fail river_init_lesser ~/.config/river/res/moonlander.ron
+    ''
+    else if hostName == "lahmu" || hostName == "apzu" || hostName == "mammun" || hostName == "isimud"
+    then ''
+      err_fail riverctl keyboard-layout 'dvorak'
+      err_fail river_init_lesser ~/.config/river/res/keys.ron
+    ''
+    else builtins.throw "Host not covered in river mappings";
+  screen_setup =
+    if hostName == "lahmu"
+    then ''
+      err_fail wlr-randr --output Virtual-1 --mode 1920x1080
+    ''
+    else if hostName == "tiamat"
+    then ''
+      err_fail wlr-randr --output DP-2 --pos 2560,0
+      err_fail wlr-randr --output DP-1 --scale 1.5 --pos 0,0
+      err_fail gammastep &
+    ''
+    else if hostName == "apzu" || hostName == "mammun" || hostName == "isimud"
+    then ''
+      err_fail gammastep &
+    ''
+    else builtins.throw "Host not covered in river screen setup";
+  init_scr = pkgs.substituteAll {
+    src = ./init;
+    inherit mappings screen_setup;
+  };
+in {
+  xdg.configFile."river/init".source =
+    sysLib.writeShellScriptWithLibraryAndKeepPath {
+      name = "river_init";
+      src = init_scr;
+      dependencies = builtins.attrValues {
+        river_init_lesser = river_init_lesser.packages.${system}.default;
+        inherit
+          (pkgs)
+          dash
+          river
+          glib # gnome lib
+          gammastep
+          wlr-randr
+          yambar
+          mako
+          swaybg
+          swayidle
+          swaylock
+          alacritty
+          ;
+      };
+    }
+    + /bin/river_init;
+
+  xdg.configFile."river/res".source = ./res;
+}