nixos/modules/dwm.nix

57 lines
1.4 KiB
Nix

{ lib, config, pkgs, ... }:
let
cfg = config.snowhawk.dwm;
in
{
options.snowhawk.dwm = {
enable = lib.mkEnableOption "dwm";
};
config = lib.mkIf cfg.enable {
services.xserver.windowManager.dwm = {
enable = true;
package = pkgs.dwm.overrideAttrs (oldAttrs: {
patches = [
../home/dwm/config.def.h-6.5.diff
];
});
};
services.picom = {
enable = true;
fade = false;
};
systemd.user.services.screenlayout = {
script = ''
${pkgs.xorg.xrandr}/bin/xrandr \
--output DP-0 --primary --mode 1920x1080 --pos 1922x0 --rotate normal \
--output DP-1 --off \
--output HDMI-0 --mode 1920x1080 --pos 0x0 --rotate normal \
--output DP-2 --off \
--output DP-3 --off \
--output HDMI-1 --off \
--output DP-4 --off \
--output DP-5 --off
'';
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
};
systemd.user.services.xrootdatetime = {
script = ''
while true; do
sleep 1 && date +"<-- %A, %B %d -- %H:%M -->" | xargs -I% ${pkgs.xorg.xsetroot}/bin/xsetroot -name %
done
'';
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
};
environment.systemPackages = with pkgs; [
dmenu
];
};
}