nixos/modules/dwm.nix

95 lines
2.2 KiB
Nix
Raw Normal View History

2024-06-28 20:22:34 -07:00
{ lib, config, pkgs, inputs, ... }:
2024-05-30 22:58:55 -07:00
let
2024-10-09 19:51:25 -07:00
inherit (lib) getExe;
2024-05-30 22:58:55 -07:00
cfg = config.snowhawk.dwm;
in
{
options.snowhawk.dwm = {
enable = lib.mkEnableOption "dwm";
};
config = lib.mkIf cfg.enable {
2024-06-28 18:35:31 -07:00
# Enable the X11 windowing system.
services.xserver.enable = true;
2024-09-13 19:41:48 -07:00
# Configure keymap in X11
services.xserver = {
xkb = {
layout = "us";
variant = "";
};
};
2024-05-30 22:58:55 -07:00
services.xserver.windowManager.dwm = {
enable = true;
2024-06-06 18:42:54 -07:00
package = pkgs.dwm.overrideAttrs (oldAttrs: {
src = inputs.zdwm;
2024-11-29 19:46:20 -08:00
buildInputs = oldAttrs.buildInputs ++ [ pkgs.yajl ];
2024-06-06 18:42:54 -07:00
});
2024-05-30 22:58:55 -07:00
};
2024-05-31 01:50:59 -07:00
2024-06-26 02:09:59 -07:00
services.picom = {
enable = true;
fade = false;
};
2024-06-27 19:22:58 -07:00
systemd.user.services.xrootdatetime = {
script =
let
pamixer = getExe pkgs.pamixer;
xsetroot = getExe pkgs.xorg.xsetroot;
in
/* bash */ ''
2024-10-30 21:11:25 -07:00
function update_x_root() {
set +e # allow errors
mute="$(${pamixer} --default-source --get-mute)"
set -e # disallow errors
if [[ "$mute" == "true" ]]; then
mutedString="Mic Muted "
else
mutedString=""
fi
dateTime=$(date +"<-- %A, %B %d -- %H:%M -->")
${xsetroot} -name "$mutedString$dateTime"
2024-10-30 21:11:25 -07:00
}
trap update_x_root SIGUSR1
while true; do
sleep 1 &
wait
update_x_root
done
'';
2024-06-27 19:22:58 -07:00
wantedBy = [ "graphical-session.target" ];
2024-10-18 12:49:43 -07:00
after = [ "pipewire.service" ];
2024-10-18 11:55:38 -07:00
serviceConfig.Restart = "on-failure";
2024-06-27 19:22:58 -07:00
};
2024-06-28 19:26:14 -07:00
systemd.user.services.fehbg = {
script = ''
2024-10-09 19:51:25 -07:00
${getExe pkgs.feh} --no-fehbg --bg-scale '${inputs.backgrounds}/bg-none-nord.webp'
2024-06-28 19:26:14 -07:00
'';
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
};
2024-11-20 06:37:00 -08:00
environment.variables.FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0";
2024-05-31 01:50:59 -07:00
environment.systemPackages = with pkgs; [
dmenu
2024-06-30 01:24:09 -07:00
xclip
2024-12-13 04:39:28 -08:00
flameshot
2024-05-31 01:50:59 -07:00
];
home-manager.sharedModules = [
./home/dwm.nix
{ snowhawk.dwm.enable = lib.mkDefault true; }
];
2024-05-30 22:58:55 -07:00
};
}