nixos/modules/dwl.nix

71 lines
1.7 KiB
Nix
Raw Normal View History

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