about summary refs log blame commit diff stats
path: root/hm/soispha/wms/river/default.nix
blob: 30b3b016381484307cbfafa3bc1eea106cdc8caf (plain) (tree)
1
2
3
4
5
6
7
 
       
         
                    
              
         
     



                                            
                                                     
                                                                   
                                                                                                     
           
                                                         












                                                             
                                                                              
           
                          





                                                                 
                                      
                                                   
                          
                     
                                          
                                                                         
                
              






                          
                  




                      
                                            
{
  pkgs,
  sysLib,
  river_init_lesser,
  nixosConfig,
  system,
  ...
}: let
  inherit (nixosConfig.networking) hostName;
  mappings =
    if hostName == "tiamat"
    then ''
      err_fail riverctl keyboard-layout 'us-modified'
      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-modified'
      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;
}