about summary refs log tree commit diff
path: root/users/fcuny/desktop/sway/default.nix
blob: 564066494359a48246ed7031f9fb41a9ae742093 (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
{ config, lib, pkgs, ... }:

{
  imports = [
    ./waybar.nix
    ./sway-idle.nix
    ./wofi.nix
    ./gammastep.nix
  ];

  home.packages = [
    pkgs.pavucontrol
    pkgs.wev
    pkgs.wf-recorder
    pkgs.wofi
  ];

  # Variables I want to be loaded by sway when started (this requires
  # `systemdIntegration` to be set to `true`).
  systemd.user.sessionVariables = {
    # Without it, firefox stays blurry, no matter where I define that variable
    MOZ_ENABLE_WAYLAND = 1;
    # Without it, I can't get the pinentry prompt
    WAYLAND_DISPLAY = "wayland-1";
  };

  home.sessionVariables = {
    LIBSEAT_BACKEND = "logind";
    MOZ_ENABLE_WAYLAND = true;
    XDG_CURRENT_DESKTOP = "sway";
    XDG_SESSION_TYPE = "wayland";
  };

  wayland.windowManager.sway = {
    enable = true;
    systemdIntegration = true;
    config = rec {
      modifier = "Mod4";
      terminal = "${config.programs.alacritty.package}/bin/alacritty";
      menu = "${pkgs.wofi}/bin/wofi -S run";
      bars = [ ];
      fonts = {
        names = [ "Source Code Pro" ];
        size = 10.0;
      };
      input = {
        "*" = {
          "xkb_layout" = "us,fr";
          # map capslock to ctrl, and switch layout using shift+caps
          "xkb_options" = "ctrl:nocaps,grp:shift_caps_toggle";
        };
      };
      output = {
        "*" = {
          scale = "1.5";
        };
        # This is for aptos
        "eDP-1" = {
          scale = "1.4";
        };
      };
    };
  };
}