nixcfg/homeManagerModules/desktop/hyprland/default.nix
Aly Raffauf 09cea45f8e
Some checks failed
nix-build / default-build (push) Has been cancelled
nix-build / fallarbor-build (push) Has been cancelled
nix-build / lavaridge-build (push) Has been cancelled
nix-build / mauville-build (push) Has been cancelled
nix-build / petalburg-build (push) Has been cancelled
nix-build / rustboro-build (push) Has been cancelled
nix-check / fmt-check (push) Has been cancelled
nix-check / eval-check (push) Has been cancelled
home/hyprland: nixify extraConfig
2024-07-19 13:40:36 -04:00

53 lines
1.5 KiB
Nix

{
config,
lib,
pkgs,
...
}: let
cfg = config.ar.home;
in {
config = lib.mkIf cfg.desktop.hyprland.enable {
wayland.windowManager.hyprland = {
enable = true;
settings = import ./settings.nix {inherit config lib pkgs;};
extraConfig = let
moveMonitorBinds =
lib.attrsets.mapAttrsToList (
key: direction: "bind=CONTROL,${key},movecurrentworkspacetomonitor,${direction}"
)
cfg.desktop.hyprland.windowManagerBinds;
moveWindowBinds =
lib.attrsets.mapAttrsToList (
key: direction: "bind=,${key},movewindow,${direction}"
)
cfg.desktop.hyprland.windowManagerBinds;
moveWorkspaceBinds = builtins.map (x: "bind=,${toString x},workspace,${toString x}") [1 2 3 4 5 6 7 8 9];
in ''
submap=resize
binde=,down,resizeactive,0 10
binde=,left,resizeactive,-10 0
binde=,right,resizeactive,10 0
binde=,up,resizeactive,0 -10
binde=,j,resizeactive,0 10
binde=,h,resizeactive,-10 0
binde=,l,resizeactive,10 0
binde=,k,resizeactive,0 -10
bind=,escape,submap,reset
submap=reset
submap=move
${lib.strings.concatLines moveMonitorBinds}
${lib.strings.concatLines moveWindowBinds}
${lib.strings.concatLines moveWorkspaceBinds}
bind=,comma,exec,${lib.getExe pkgs.hyprnome} --previous --move
bind=,period,exec,${lib.getExe pkgs.hyprnome} --move
bind=,escape,submap,reset
submap=reset
'';
};
};
}