about summary refs log tree commit diff
path: root/users/tazjin/nixos/modules/desktop.nix
blob: f3cde6326c58901f2a7c01dd262ccb0b03c59787 (plain) (blame)
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
# EXWM and other desktop configuration.
{ config, depot, lib, pkgs, ... }:

{
  services = {
    pipewire = {
      enable = true;
      alsa.enable = true;
      alsa.support32Bit = true;
      pulse.enable = true;
    };

    blueman.enable = true;
    libinput.enable = true;

    xserver = {
      enable = true;
      xkb.layout = "us";
      xkb.options = "caps:super";

      displayManager.sessionPackages = [ pkgs.niri ];
      displayManager.gdm = {
        enable = true;
        wayland = true;
      };
    };
  };

  programs.xwayland.enable = true;

  environment.systemPackages = with pkgs; [
    # core packages
    niri
    xwayland-satellite
    swaylock

    # support tooling
    alacritty
    qt5.qtwayland
    sfwbar
    swayidle
    waybar
    wdisplays
    wl-mirror
    xfce.xfce4-appfinder
  ];

  # Do not restart the display manager automatically
  systemd.services.display-manager.restartIfChanged = lib.mkForce false;

  # pipewire MUST start before niri, otherwise screen sharing doesn't work
  systemd.user.services.pipewire.wantedBy = [ "niri.service" ];
  systemd.user.services.pipewire.before = [ "niri.service" ];

  # swaylock needs an empty PAM configuration, otherwise it locks the user out
  security.pam.services.swaylock = { };

  # enable theming support for Qt that is compatible with Chicago95 theme
  qt.enable = true;
  qt.platformTheme = "qt5ct";

  # If something needs more than 10s to stop it should probably be
  # killed.
  systemd.extraConfig = ''
    DefaultTimeoutStopSec=10s
  '';
}