nixos/modules/dwl.nix

60 lines
1.4 KiB
Nix
Raw Normal View History

2024-10-06 16:59:19 +00:00
{ lib, config, pkgs, ... }:
let
cfg = config.snowhawk.dwl;
in
{
options.snowhawk.dwl = {
enable = lib.mkEnableOption "dwl";
2024-10-07 04:20:25 +00:00
package = lib.mkOption {
type = with lib.types; package;
default = pkgs.dwl;
apply = p: p.overrideAttrs {
postInstall = ''
mkdir -p $out/share/wayland-sessions
install $src/dwl.desktop -Dt $out/share/wayland-sessions
'';
passthru.providedSessions = [ "dwl" ];
};
};
2024-10-06 16:59:19 +00:00
};
config = lib.mkIf cfg.enable {
services.graphical-desktop.enable = lib.mkDefault true;
2024-10-07 04:20:25 +00:00
services.displayManager.sessionPackages = [ cfg.package ];
2024-10-07 03:09:00 +00:00
services.displayManager.defaultSession = "dwl";
2024-10-06 16:59:19 +00:00
security = {
polkit.enable = lib.mkDefault true;
# Uncomment to make swaylock work
# pam.services.swaylock = { };
};
2024-10-07 04:42:37 +00:00
environment.sessionVariables.NIXOS_OZONE_WL = "1";
2024-10-06 16:59:19 +00:00
programs = {
dconf.enable = lib.mkDefault true;
xwayland.enable = lib.mkDefault true;
};
xdg.portal.wlr.enable = lib.mkDefault true;
xdg.portal.extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050913
xdg.portal.config.dwl.default = lib.mkDefault [ "wlr" "gtk" ];
services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkDefault true;
environment.systemPackages = with pkgs; [
wl-clipboard
2024-10-07 04:25:18 +00:00
wmenu
foot
2024-10-06 16:59:19 +00:00
cfg.package
];
};
}