summaryrefslogtreecommitdiff
path: root/hm/env/niri/niri.nix
blob: f8e15428f4355cc2c358447973f8a3e1809856fe (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
{
  config,
  lib,
  pkgs,
  osConfig,
  ...
}:
let
  cfg = config.hm.env.niri;
in
{
  options.hm.env.niri.enable = lib.mkEnableOption "niri hm";
  config = lib.mkIf cfg.enable {
    hm.env = {
      awww.enable = true;
      fuzzel.enable = true;
      screenshot.enable = true;
      swayidle.enable = true;
      swaylock.enable = true;
    };

    programs.niri.settings = {
      debug.disable-cursor-plane = [ ];
      binds = import ./binds.nix {
        inherit
          config
          osConfig
          lib
          pkgs
          ;
      };

      prefer-no-csd = true;
      hotkey-overlay.skip-at-startup = true;
      input = {
        mouse = {
          accel-profile = "flat";
          accel-speed = -0.6;
          middle-emulation = true;
          scroll-factor = 1.5;
        };
        focus-follows-mouse = {
          enable = true;
          max-scroll-amount = "10%";
        };
        mod-key = "Alt";
        keyboard = {
          xkb.layout = "pl";
          repeat-delay = 300;
          repeat-rate = 60;
        };
        power-key-handling.enable = false;
      };
      cursor = {
        hide-when-typing = true;
        size = 48;
      };
      layout = {
        empty-workspace-above-first = true;
        border = {
          width = 2;
          # active = <decoration>;
        };
        focus-ring = {
          width = 2;
          # active = <decoration>;
        };
        preset-column-widths = [
          { proportion = 1. / 3.; }
          { proportion = 1. / 2.; }
          { proportion = 2. / 3.; }
        ];
        preset-window-heights = [
          { proportion = 1. / 3.; }
          { proportion = 1. / 2.; }
          { proportion = 2. / 3.; }
        ];
        default-column-width.proportion = 0.5;
        tab-indicator = {
          gaps-between-tabs = 3;
          position = "top";
        };
      };
      window-rules = [
        {
          matches = [
            { app-id = "Bitwarden"; }
          ];
          block-out-from = "screen-capture";
        }
      ];
      gestures.hot-corners.enable = false;
      spawn-at-startup = [
        {
          command = [
            "obs"
            "--disable-missing-files-check"
            "--startreplaybuffer"
          ];
        }
      ];
    };
    home.packages = with pkgs; [
      qalculate-gtk
      gavin-bc
    ];
  };
}