{ config, pkgs, lib, ... }: let dwl-startup = pkgs.writeScript "dwl-startup.sh" '' #!${pkgs.bash}/bin/bash ${pkgs.yambar}/bin/yambar ''; launch_emacs = pkgs.writeScript "emacsclient-or-start" '' #!${pkgs.bash}/bin/bash emacsclient --create-frame --alternate-editor="" ''; in { imports = [ ./wayland.nix ]; nixpkgs.overlays = [ (final: prev: { dwl = prev.dwl.overrideAttrs (old: { postPatch = '' export termcmd=${pkgs.foot}/bin/foot export editcmd=${launch_emacs} export menucmd=${pkgs.fuzzel}/bin/fuzzel substituteAll ${./dwl/config.def.h} ./config.def.h ''; postInstall = '' sed -i "s#Exec=dwl#Exec=dwl -s ${dwl-startup}#" $out/share/wayland-sessions/dwl.desktop chmod ugo+x $out/share/wayland-sessions/dwl.desktop ''; passthru.providedSessions = ["dwl"]; }); }) ]; environment.sessionVariables = { NIXOS_OZONE_WL=1; WLR_NO_HARDWARE_CURSORS=1; SDL_VIDEODRIVER="wayland"; QT_QPA_PLATFORM="wayland-egl"; QT_WAYLAND_DISABLE_WINDOW_DECORATIONS="1"; __JAVA_AWT_WM_NONREPARENTING=1; }; environment.systemPackages = with pkgs; [ dwl yambar foot ]; }