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 166 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 ../../tmux.nix 14 ../../themes.nix 15 ../../fonts.nix 16 # ../pipewire.nix 17 # ./tty-share.nix 18 { 19 users.users.mainUser.packages = [ 20 pkgs.sshuttle 21 self.packages.${pkgs.system}.mpv 22 ]; 23 security.sudo.extraConfig = '' 24 lass ALL= (root) NOPASSWD:SETENV: ${pkgs.sshuttle}/bin/.sshuttle-wrapped 25 ''; 26 } 27 ]; 28 29 services.earlyoom = { 30 enable = true; 31 freeMemThreshold = 5; 32 }; 33 34 users.users.mainUser.extraGroups = [ 35 "audio" 36 "pipewire" 37 "video" 38 "input" 39 ]; 40 41 xdg.portal.enable = true; 42 xdg.portal.extraPortals = [ 43 pkgs.xdg-desktop-portal-gtk 44 pkgs.xdg-desktop-portal-wlr 45 ]; 46 # xdg.portal.wlr.enable = true; 47 xdg.portal.config.common.default = "wlr"; 48 fonts.enableDefaultPackages = true; 49 50 security.polkit.enable = true; 51 security.pam.services.swaylock = { }; 52 53 programs.dconf.enable = lib.mkDefault true; 54 services.gnome.gnome-keyring.enable = lib.mkDefault true; 55 programs.xwayland.enable = lib.mkDefault true; 56 57 environment.sessionVariables = { 58 MOZ_ENABLE_WAYLAND = "1"; 59 XDG_SESSION_TYPE = "wayland"; 60 SDL_VIDEODRIVER = "wayland"; 61 QT_QPA_PLATFORM = "wayland"; 62 QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; 63 _JAVA_AWT_WM_NONREPARENTING = "1"; 64 NIXOS_OZONE_WL = "1"; # Hint for electron apps to use wayland 65 }; 66 67 programs.wshowkeys.enable = true; 68 69 environment.systemPackages = with pkgs; [ 70 # (gamescope.overrideAttrs (old: { 71 # patches = old.patches ++ [ 72 # ./gamescope_libinput.patch 73 # ]; 74 # 75 # })) 76 swaylock-effects # lockscreen 77 pavucontrol 78 swayidle 79 rofi-wayland 80 rofi-rbw 81 eog 82 libnotify 83 mako # notifications 84 kanshi # auto-configure display outputs 85 wdisplays # buggy with qtile? 86 wlr-randr 87 wl-clipboard 88 wev 89 blueberry 90 grim # screenshots 91 wtype 92 zathura 93 nsxiv 94 95 pavucontrol 96 evince 97 libnotify 98 pamixer 99 file-roller 100 xdg-utils 101 # polkit agent 102 polkit_gnome 103 104 self.packages.${pkgs.system}.wifi-qr 105 106 # gtk3 themes 107 gsettings-desktop-schemas 108 (pkgs.writers.writeDashBin "pass_menu" '' 109 set -efux 110 password=$( 111 (cd $HOME/.password-store; find -type f -name '*.gpg') | 112 sed -e 's/\.gpg$//' | 113 rofi -dmenu -p 'Password: ' | 114 xargs -I{} pass show {} | 115 tr -d '\n' 116 ) 117 echo -n "$password" | ${pkgs.wtype}/bin/wtype -d 10 -s 400 - 118 '') 119 (pkgs.writers.writeDashBin "screenshot" '' 120 ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.wl-clipboard}/bin/wl-copy 121 '') 122 (pkgs.writers.writeDashBin "type_paste" '' 123 ${pkgs.wl-clipboard}/bin/wl-paste | ${pkgs.wtype}/bin/wtype -d 10 -s 400 - 124 '') 125 ]; 126 127 environment.pathsToLink = [ 128 "/libexec" # for polkit 129 "/share/gsettings-schemas" # for XDG_DATA_DIRS 130 ]; 131 132 qt.platformTheme = "qt5ct"; 133 134 security.pam.services.swaylock = { }; 135 security.pam.services.swaylock.fprintAuth = true; 136 137 # from nixpkgs/nixos/modules/services/system/systemd-lock-handler.md 138 services.systemd-lock-handler.enable = true; 139 140 systemd.user.services.swaylock = { 141 description = "Screen locker for Wayland"; 142 documentation = [ "man:swaylock(1)" ]; 143 144 # If swaylock exits cleanly, unlock the session: 145 onSuccess = [ "unlock.target" ]; 146 147 # When lock.target is stopped, stops this too: 148 partOf = [ "lock.target" ]; 149 150 # Delay lock.target until this service is ready: 151 before = [ "lock.target" ]; 152 wantedBy = [ "lock.target" ]; 153 154 serviceConfig = { 155 # systemd will consider this service started when swaylock forks... 156 Type = "forking"; 157 158 # ... and swaylock will fork only after it has locked the screen. 159 ExecStart = "${lib.getExe pkgs.swaylock} --image /var/lib/wallpaper/wallpaper -f"; 160 161 # If swaylock crashes, always restart it immediately: 162 Restart = "on-failure"; 163 RestartSec = 0; 164 }; 165 }; 166}