105 lines
3.2 KiB
Nix
105 lines
3.2 KiB
Nix
{ config, pkgs, lib, ... }: let
|
|
launch_emacs = pkgs.writeScript "emacsclient-or-start" ''
|
|
#!${pkgs.bash}/bin/bash
|
|
emacsclient --create-frame --alternate-editor=""
|
|
'';
|
|
in {
|
|
imports = [
|
|
./wayland.nix
|
|
];
|
|
|
|
nixpkgs.overlays = [
|
|
(final: prev: {
|
|
wlroots_0_19 = prev.wlroots_0_18.overrideAttrs (old: {
|
|
src = final.fetchFromGitLab {
|
|
domain = "gitlab.freedesktop.org";
|
|
owner = "wlroots";
|
|
repo = "wlroots";
|
|
rev = "47fb00f66d5a8367d0108bd960f99e51ab1a1318"; # 0.19-prev
|
|
hash = "sha256-HkpTML14tbYBLiHkqoFRSn/qKsVny/oso2TuG6LY/fk=";
|
|
};
|
|
});
|
|
dwl = (prev.dwl.override { wlroots = final.wlroots_0_19; }).overrideAttrs (old: let
|
|
dwl-patches = pkgs.fetchgit {
|
|
url = "https://codeberg.org/dwl/dwl-patches.git";
|
|
rev = "8b1f9fbdb2c3394bc26a9ff0ac872f64c38e29f7";
|
|
hash = "sha256-fW7cJC2uT9uV0fdB/5rjHOWnQHouvjJrcem1hENm6R0=";
|
|
};
|
|
patches = let
|
|
dwl-patch = p: "${dwl-patches}/patches/${p}/${p}.patch";
|
|
in [
|
|
(dwl-patch "ipc")
|
|
(dwl-patch "restore-monitor")
|
|
(dwl-patch "regexrules")
|
|
(dwl-patch "autostart")
|
|
];
|
|
in {
|
|
version = "21-09-2024";
|
|
|
|
src = final.fetchFromGitea {
|
|
domain = "codeberg.org";
|
|
owner = "dwl";
|
|
repo = "dwl";
|
|
rev = "002c7d22043da56a54511b5d234c2e3bd997d119";
|
|
hash = "sha256-mgO+iTJmAM0N5Q+6fAfMAOU0O1T8xUWRdaIcbRX3Pa8=";
|
|
};
|
|
|
|
patches = (old.patches or []) ++ patches;
|
|
postPatch = (old.postPatch or "") + ''
|
|
export termcmd=${pkgs.foot}/bin/foot
|
|
export editcmd=${launch_emacs}
|
|
export menucmd=${pkgs.fuzzel}/bin/fuzzel
|
|
export barcmd=${pkgs.waybar}/bin/waybar
|
|
export playcmd=${pkgs.writeScript "playerctl-play-pause" ''
|
|
#!${pkgs.bash}/bin/bash
|
|
${pkgs.playerctl}/bin/playerctl play-pause
|
|
''}
|
|
export scrncmd=${pkgs.writeScript "screenshot-region" ''
|
|
#!${pkgs.bash}/bin/bash
|
|
${pkgs.slurp}/bin/slurp | ${pkgs.grim}/bin/grim -g - - | ${pkgs.wl-clipboard}/bin/wl-copy
|
|
''}
|
|
substituteAll ${./dwl/config.def.h} ./config.def.h
|
|
'';
|
|
postInstall = ''
|
|
chmod ugo+x $out/share/wayland-sessions/dwl.desktop
|
|
'';
|
|
passthru.providedSessions = ["dwl"];
|
|
});
|
|
})
|
|
];
|
|
|
|
environment.sessionVariables = {
|
|
# Breaks WebCord
|
|
# 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;
|
|
GTK_THEME="Adwaita-dark";
|
|
};
|
|
|
|
xdg.portal.wlr = {
|
|
enable = true;
|
|
settings = {
|
|
screencast = {
|
|
output_name = "DP-2";
|
|
max_fps = 30;
|
|
chooser_type = "simple";
|
|
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
|
|
};
|
|
};
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
dwl
|
|
waybar
|
|
foot
|
|
pwvucontrol
|
|
];
|
|
}
|