This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / 2configs / desktops / lib / wayland.nix
3.6 kB 154 lines
1{ 2 self, 3 pkgs, 4 lib, 5 ... 6}: 7{ 8 imports = [ 9 ../../alacritty.nix 10 ../../kitty.nix 11 ../../xdg-open.nix 12 ../../yubikey.nix 13 ../../themes.nix 14 ../../fonts.nix 15 # ../pipewire.nix 16 # ./tty-share.nix 17 { 18 users.users.mainUser.packages = [ 19 pkgs.sshuttle 20 self.packages.${pkgs.system}.mpv 21 ]; 22 security.sudo.extraConfig = '' 23 lass ALL= (root) NOPASSWD:SETENV: ${pkgs.sshuttle}/bin/.sshuttle-wrapped 24 ''; 25 } 26 ]; 27 28 services.earlyoom = { 29 enable = true; 30 freeMemThreshold = 5; 31 }; 32 33 users.users.mainUser.extraGroups = [ 34 "audio" 35 "video" 36 "input" 37 ]; 38 39 xdg.portal.enable = true; 40 xdg.portal.extraPortals = [ 41 pkgs.xdg-desktop-portal-gtk 42 pkgs.xdg-desktop-portal-wlr 43 ]; 44 # xdg.portal.wlr.enable = true; 45 xdg.portal.config.common.default = "wlr"; 46 fonts.enableDefaultPackages = true; 47 48 security.polkit.enable = true; 49 security.pam.services.swaylock = { }; 50 security.pam.services.swaylock-plugin = { }; 51 52 programs.dconf.enable = lib.mkDefault true; 53 services.gnome.gnome-keyring.enable = lib.mkDefault true; 54 programs.xwayland.enable = lib.mkDefault true; 55 56 environment.sessionVariables = { 57 MOZ_ENABLE_WAYLAND = "1"; 58 XDG_SESSION_TYPE = "wayland"; 59 SDL_VIDEODRIVER = "wayland"; 60 QT_QPA_PLATFORM = "wayland"; 61 QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; 62 _JAVA_AWT_WM_NONREPARENTING = "1"; 63 NIXOS_OZONE_WL = "1"; # Hint for electron apps to use wayland 64 }; 65 66 programs.wshowkeys.enable = true; 67 68 environment.systemPackages = with pkgs; [ 69 # (gamescope.overrideAttrs (old: { 70 # patches = old.patches ++ [ 71 # ./gamescope_libinput.patch 72 # ]; 73 # 74 # })) 75 swaylock-effects # lockscreen 76 pavucontrol 77 swayidle 78 rofi 79 rofi-rbw 80 eog 81 libnotify 82 mako # notifications 83 kanshi # auto-configure display outputs 84 wdisplays # buggy with qtile? 85 wlr-randr 86 wl-clipboard 87 wev 88 blueberry 89 grim # screenshots 90 wtype 91 zathura 92 nsxiv 93 94 pavucontrol 95 evince 96 libnotify 97 pamixer 98 file-roller 99 xdg-utils 100 # polkit agent 101 polkit_gnome 102 103 self.packages.${pkgs.system}.menu 104 105 # gtk3 themes 106 gsettings-desktop-schemas 107 (pkgs.writers.writeDashBin "screenshot" '' 108 ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy 109 '') 110 (pkgs.writers.writeDashBin "type_paste" '' 111 ${pkgs.wl-clipboard}/bin/wl-paste | ${pkgs.wtype}/bin/wtype -d 10 -s 400 - 112 '') 113 ]; 114 115 environment.pathsToLink = [ 116 "/libexec" # for polkit 117 "/share/gsettings-schemas" # for XDG_DATA_DIRS 118 ]; 119 120 qt.platformTheme = "qt5ct"; 121 122 # from nixpkgs/nixos/modules/services/system/systemd-lock-handler.md 123 services.systemd-lock-handler.enable = true; 124 125 systemd.user.services.swaylock = { 126 description = "Screen locker for Wayland"; 127 documentation = [ "man:swaylock(1)" ]; 128 129 # Requires graphical session 130 requisite = [ "graphical-session.target" ]; 131 after = [ "graphical-session.target" ]; 132 133 # If swaylock exits cleanly, unlock the session: 134 onSuccess = [ "unlock.target" ]; 135 136 # When lock.target is stopped, stops this too: 137 partOf = [ "lock.target" ]; 138 139 # Delay lock.target until this service is ready: 140 before = [ "lock.target" ]; 141 wantedBy = [ "lock.target" ]; 142 143 serviceConfig = { 144 Type = "simple"; 145 # If swaylock crashes, always restart it immediately: 146 Restart = "on-failure"; 147 RestartSec = 0; 148 }; 149 150 path = [ pkgs.bash ]; 151 152 serviceConfig.ExecStart = lib.getExe self.packages.${pkgs.system}.lockscreen; 153 }; 154}