aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/common/optional/services/wayland.nix
blob: 0f7941274c91a14f75d612578949fc3956d8481d (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
130
131
132
133
134
135
136
137
{ config, lib, pkgs, ... }:
{
  environment.systemPackages = [
    pkgs.chafa
    pkgs.evince
    pkgs.feh
    pkgs.gcr
    pkgs.geeqie
    pkgs.ghostty
    pkgs.gimp
    #pkgs.gimp-with-plugins
    pkgs.google-chrome
    pkgs.grim
    pkgs.gv
    pkgs.inkscape
    pkgs.kdePackages.okular
    pkgs.libreoffice
    pkgs.libva-utils
    pkgs.mako
    pkgs.mesa-demos
    pkgs.mpv
    pkgs.polkit_gnome
    pkgs.rdesktop
    pkgs.read-edid
    pkgs.slurp
    pkgs.st
    pkgs.sxiv
    pkgs.tigervnc
    pkgs.turbovnc
    pkgs.vdpauinfo
    pkgs.vlc
    pkgs.vulkan-tools
    pkgs.wireshark
    pkgs.wl-clipboard
    pkgs.x11vnc
    pkgs.xclip
    pkgs.xdotool
    pkgs.xorg.appres
    pkgs.xorg.editres
    pkgs.xorg.xdpyinfo
    pkgs.xorg.xev
    pkgs.xscreensaver
    pkgs.xsnow
    pkgs.xterm
  ];

  programs = {
    firefox = {
      enable = true;
      package = pkgs.master.firefox;
    };

    #regreet= {
    #  enable = true;
    #  settings = {
    #    GTK = {
    #      application_prefer_dark_theme = true;
    #      cursor_theme_name = "catppuccin-mocha-blue-cursors";
    #      font_name = "Work Sans 16";
    #      icon_theme_name = "Papirus-Dark";
    #      theme_name = "catppuccin-mocha-blue-standard";
    #    };
    #  };
    #};

    sway = {
      enable = true;
      wrapperFeatures.gtk = true;
    };

    waybar.enable = true;
  };

  #services.greetd = {
  #  enable = true;
  #  #settings = {
  #  #  default_session = {
  #  #    command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway";
  #  #    user = "greeter";
  #  #  };
  #  #};
  #};

  security = {
    pam.loginLimits = [
      { domain = "@users"; item = "rtprio"; type = "-"; value = 1; }
    ];

    polkit = {
      enable = true;
      extraConfig = ''
        polkit.addRule(function(action, subject) {
          if (
            subject.isInGroup("users")
              && (
                action.id == "org.freedesktop.login1.reboot" ||
                action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
                action.id == "org.freedesktop.login1.power-off" ||
                action.id == "org.freedesktop.login1.power-off-multiple-sessions"
              )
            )
          {
            return polkit.Result.YES;
          }
        })
      '';
    };
  };

  services = {
    blueman.enable = true;

    displayManager.sddm = {
      enable = true;
      wayland.enable = true;
    };

    libinput.enable = true;
    printing.enable = true;
  };

  systemd = {
    user.services.polkit-gnome-authentication-agent-1 = {
      description = "polkit-gnome-authentication-agent-1";
      wantedBy = [ "graphical-session.target" ];
      wants = [ "graphical-session.target" ];
      after = [ "graphical-session.target" ];
      serviceConfig = {
          Type = "simple";
          ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
          Restart = "on-failure";
          RestartSec = 1;
          TimeoutStopSec = 10;
        };
    };
  };
}