Files
NixMachines/machines/universedesktop/desktop/dwl.nix

53 lines
1.4 KiB
Nix

{ config, pkgs, lib, ... }: let
dwl-startup = pkgs.writeScript "dwl-startup.sh" ''
#!${pkgs.bash}/bin/bash
exec <&-
'';
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;
# Bug with Wayland: Fixed in 23.1
# Causes firefox & thunderbird to crash
# https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21646/diffs?commit_id=ee5d2250fd159689aae3f7d632a6226971bea85c
MOZ_ENABLE_WAYLAND=0;
};
environment.systemPackages = with pkgs; [
dwl
yambar
foot
];
}