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