nixos-combined-flake/modules/home-manager/desktop/awesome/awesomewm.nix

88 lines
2.0 KiB
Nix

args @ {
pkgs,
lib,
config,
...
}:
lib.mkIf config.desktop.awesome.enable {
home = {
packages = with pkgs; [
mate.mate-polkit
];
sessionVariables = {
QT_QPA_PLATFORMTHEME = "qt5ct";
};
file = {
awesomewm-rc = {
target = ".config/awesome/rc.lua";
text = import ./config/rc.nix args;
};
awesomewm-theme = {
target = ".config/awesome/theme.lua";
text = import ./config/theme.nix args;
};
xinitrc = {
target = ".xinitrc";
text = ''
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
darkman dark
${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1 &
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval $(dbus-launch --exit-with-session --sh-syntax)
fi
systemctl --user import-environment DISPLAY XAUTHORITY
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fi
exec awesome --search ${pkgs.luaPackages.vicious}/lib/lua/5.2
'';
executable = true;
};
};
};
xsession = {
enable = true;
command = "awesome";
windowManager.awesome = {
package = pkgs.awesome.override {
lua = pkgs.luajit;
};
enable = true;
luaModules = with pkgs.luaPackages; [
luarocks
vicious
];
};
};
}