nixos/modules/dwl.nix

71 lines
1.7 KiB
Nix
Raw Normal View History

2024-12-13 04:17:01 -08:00
{ lib, config, pkgs, inputs, ... }:
2024-10-06 09:59:19 -07:00
let
cfg = config.snowhawk.dwl;
in
{
options.snowhawk.dwl = {
enable = lib.mkEnableOption "dwl";
2024-10-06 21:20:25 -07:00
package = lib.mkOption {
type = with lib.types; package;
2024-12-13 05:24:50 -08:00
default = inputs.zdwl.packages."x86_64-linux".default;
2024-10-06 21:20:25 -07:00
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 09:59:19 -07:00
};
config = lib.mkIf cfg.enable {
services.graphical-desktop.enable = lib.mkDefault true;
2024-12-08 17:40:30 -08:00
services.displayManager = {
2024-12-08 17:46:51 -08:00
enable = true;
2024-12-08 17:40:30 -08:00
sessionPackages = [ cfg.package ];
defaultSession = "dwl";
2024-12-13 04:17:01 -08:00
# TODO: greetd?
2024-12-13 01:12:24 -08:00
sddm = {
enable = lib.mkDefault true;
wayland.enable = lib.mkDefault true;
};
2024-12-08 17:40:30 -08:00
};
2024-10-06 09:59:19 -07:00
security = {
polkit.enable = lib.mkDefault true;
# Uncomment to make swaylock work
# pam.services.swaylock = { };
};
2024-12-08 15:52:40 -08:00
# environment.sessionVariables.NIXOS_OZONE_WL = "1";
2024-10-06 21:42:37 -07:00
2024-10-06 09:59:19 -07: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
2024-12-13 05:27:14 -08:00
pkgs.xdg-desktop-portal-wlr
2024-10-06 09:59:19 -07:00
];
# 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; [
2024-12-13 04:39:28 -08:00
(flameshot.override { enableWlrSupport = true; })
2024-10-06 09:59:19 -07:00
wl-clipboard
2024-10-06 21:25:18 -07:00
wmenu
2024-12-13 05:24:50 -08:00
kitty
2024-10-06 09:59:19 -07:00
cfg.package
];
};
}