Files
nix/hosts/common/user/configs/gui/theme/default.nix
2024-07-16 17:46:58 +03:00

37 lines
777 B
Nix

{
username ? throw "username argument is required",
}:
{
config,
inputs,
lib,
pkgs,
...
}:
let
userConfig = config.users.users.${username};
hmConfig = config.home-manager.users.${username};
themeBin = lib.meta.getExe hmConfig.theme.pkg;
in
{
home-manager.users.${username} = {
imports = [ ./options.nix ];
theme.enable = true;
wayland.windowManager.hyprland.settings.bind = [
"Ctrl_Alt, r, exec, ${themeBin}"
"Ctrl_Alt, t, exec, ${themeBin} toggle"
];
home = {
activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [
"writeBoundary"
] "run ${themeBin}";
persistence."/persist${userConfig.home}".directories = [
"${hmConfig.xdg.relativeConfigHome}/theme"
];
};
};
}