zaphyra's git: nixfiles

zaphyra's nixfiles

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 
{
  config,
  inputs,
  lib,
  pkgs,
  ...
}:
let
  inherit (config) wayland;
  inherit (lib) mkOptionDefault;

  DOCK_R = "Lenovo Group Limited T23d-10 V90B7ALM";
  DOCK_L = "Lenovo Group Limited T23d-10 V90B7AL8";

  ws_2 = "'2: code'";
  ws_3 = "'3: librewolf'";
  ws_4 = "'4: matrix'";

  inherit (wayland.windowManager.sway.config) modifier;

in
{

  config = {
    home = {
      packages = with pkgs; [
        grim
        pulseaudio # for pactl
        slurp
        wl-clipboard
      ];
      sessionVariables = {
        WLR_RENDERER = "vulkan"; # Fixes element-desktop flickering
      };
    };

    programs = {
      feh.enable = true;
    };

    wayland.windowManager.sway = {
      enable = true;
      extraConfig = ''
        exec element-desktop
      '';
      extraOptions = [ "--unsupported-gpu" ];
      config = {
        assigns = {
          "${ws_2}" = [ { "app_id" = "code"; } ];
          "${ws_3}" = [ { "app_id" = "librewolf"; } ];
          "${ws_4}" = [ { "app_id" = "Element"; } ];
        };
        bars = [
          {
            command = "waybar";
            mode = "hide";
          }
        ];
        gaps = {
          inner = 8;
          outer = 3;
        };
        input."*" = {
          xkb_layout = "de";
        };
        keybindings = mkOptionDefault {
          "${modifier}+2" = "workspace ${ws_2}";
          "${modifier}+3" = "workspace ${ws_3}";
          "${modifier}+4" = "workspace ${ws_4}";

          "${modifier}+Shift+2" = "move container to workspace ${ws_2}";
          "${modifier}+Shift+3" = "move container to workspace ${ws_3}";
          "${modifier}+Shift+4" = "move container to workspace ${ws_4}";

          "${modifier}+Shift+Delete" = "exec 'swaymsg exit'";
          "${modifier}+L" = "exec 'swaylock -f --grace 0'";
          "XF86MonBrightnessDown" = "exec brightnessctl 10%-";
          "XF86MonBrightnessUp" = "exec brightnessctl +10%";
          "XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +1%'";
          "XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -1%'";
          "XF86AudioMute" = "exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'";
        };
        modifier = "Mod4";
        output."*" = {
          bg = "${inputs.self.resources.void.background} fill";
        };
        terminal = "kitty";
        window.titlebar = false;
        workspaceOutputAssign = (
          (map
            (n: {
              output = DOCK_L;
              workspace = n;
            })
            [
              "6"
              "7"
              "8"
              "9"
              "10"
            ]
          )
          ++
            map
              (n: {
                output = DOCK_R;
                workspace = n;
              })
              [
                "1"
                ws_2
                ws_3
                ws_4
                "5"
              ]
        );
      };
      wrapperFeatures.gtk = true;
    };
  };

}