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
4.1 kB 165 lines
1{ 2 self, 3 pkgs, 4 lib, 5 ... 6}: 7{ 8 imports = [ 9 ../../alacritty.nix 10 ../../power-action.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 "pipewire" 36 "video" 37 "input" 38 ]; 39 40 xdg.portal.enable = true; 41 xdg.portal.extraPortals = [ 42 pkgs.xdg-desktop-portal-gtk 43 pkgs.xdg-desktop-portal-wlr 44 ]; 45 # xdg.portal.wlr.enable = true; 46 xdg.portal.config.common.default = "wlr"; 47 fonts.enableDefaultPackages = true; 48 49 security.polkit.enable = true; 50 security.pam.services.swaylock = { }; 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-wayland 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}.wifi-qr 104 105 # gtk3 themes 106 gsettings-desktop-schemas 107 (pkgs.writers.writeDashBin "pass_menu" '' 108 set -efux 109 password=$( 110 (cd $HOME/.password-store; find -type f -name '*.gpg') | 111 sed -e 's/\.gpg$//' | 112 rofi -dmenu -p 'Password: ' | 113 xargs -I{} pass show {} | 114 tr -d '\n' 115 ) 116 echo -n "$password" | ${pkgs.wtype}/bin/wtype -d 10 -s 400 - 117 '') 118 (pkgs.writers.writeDashBin "screenshot" '' 119 ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy 120 '') 121 (pkgs.writers.writeDashBin "type_paste" '' 122 ${pkgs.wl-clipboard}/bin/wl-paste | ${pkgs.wtype}/bin/wtype -d 10 -s 400 - 123 '') 124 ]; 125 126 environment.pathsToLink = [ 127 "/libexec" # for polkit 128 "/share/gsettings-schemas" # for XDG_DATA_DIRS 129 ]; 130 131 qt.platformTheme = "qt5ct"; 132 133 security.pam.services.swaylock = { }; 134 security.pam.services.swaylock.fprintAuth = true; 135 136 # from nixpkgs/nixos/modules/services/system/systemd-lock-handler.md 137 services.systemd-lock-handler.enable = true; 138 139 systemd.user.services.swaylock = { 140 description = "Screen locker for Wayland"; 141 documentation = [ "man:swaylock(1)" ]; 142 143 # If swaylock exits cleanly, unlock the session: 144 onSuccess = [ "unlock.target" ]; 145 146 # When lock.target is stopped, stops this too: 147 partOf = [ "lock.target" ]; 148 149 # Delay lock.target until this service is ready: 150 before = [ "lock.target" ]; 151 wantedBy = [ "lock.target" ]; 152 153 serviceConfig = { 154 # systemd will consider this service started when swaylock forks... 155 Type = "forking"; 156 157 # ... and swaylock will fork only after it has locked the screen. 158 ExecStart = "${lib.getExe pkgs.swaylock} --image /var/lib/wallpaper/wallpaper -f"; 159 160 # If swaylock crashes, always restart it immediately: 161 Restart = "on-failure"; 162 RestartSec = 0; 163 }; 164 }; 165}