aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/hyprland/default.nix
blob: 97e013425ab0896c7de7012824dd826d20b422aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
  config,
  lib,
  pkgs,
  ...
}:
let
  toHyprColor = hex: "rgba(${lib.removePrefix "#" hex}ff)";
in
{
  imports = [
    ./hyprpaper.nix
    ./keybindings.nix
  ];

  config = lib.mkIf config.desktop.enable {
    wayland.windowManager.hyprland = {
      enable = true;
      configType = "lua";
      xwayland.enable = true;
      systemd.enable = true;

      settings = {
        mainMod = {
          _var = "SUPER";
        };

        config = {
          general = with config.scheme.withHashtag; {
            gaps_in = 5;
            gaps_out = 5;
            border_size = 1;
            col = {
              active_border = {
                colors = [ (toHyprColor base03) ];
                angle = 45;
              };
              inactive_border = toHyprColor base00;
            };
            layout = "dwindle";
          };

          decoration = {
            rounding = 0;
          };

          input = {
            follow_mouse = 1;
            kb_layout = "us";
          };

          cursor = {
            enable_hyprcursor = true;
          };

          dwindle = {
            preserve_split = true;
          };
        };

        window_rule = [
          {
            name = "float-file-explorer";
            match.class = "^(file-explorer)$";
            float = true;
          }
          {
            name = "size-file-explorer";
            match.class = "^(file-explorer)$";
            size = "1280 720";
          }
          {
            name = "center-file-explorer";
            match.class = "^(file-explorer)$";
            center = true;
          }

          {
            name = "float-rofi";
            match.class = "^(rofi)$";
            float = true;
          }
          {
            name = "size-rofi";
            match.class = "^(rofi)$";
            size = "800 600";
          }
          {
            name = "center-rofi";
            match.class = "^(rofi)$";
            center = true;
          }

          {
            name = "float-keybindings-viewer";
            match.class = "^(keybindings-viewer)$";
            float = true;
          }
          {
            name = "size-keybindings-viewer";
            match.class = "^(keybindings-viewer)$";
            size = "1280 720";
          }
          {
            name = "center-keybindings-viewer";
            match.class = "^(keybindings-viewer)$";
            center = true;
          }
        ];
      };
    };

    home.pointerCursor = {
      enable = true;
      package = pkgs.rose-pine-hyprcursor;
      name = "rose-pine-hyprcursor";
      size = 20;
      hyprcursor.enable = true;
      gtk.enable = false;
      x11.enable = false;
    };

    home.packages = with pkgs; [
      grim
      slurp
      wl-clipboard
    ];
  };
}