Files
nix/users/configs/theme/default.nix
2024-06-25 17:31:49 +03:00

30 lines
781 B
Nix

{ user ? throw "user argument is required" }: { config, inputs, lib, pkgs, ... }:
let
hmConfig = config.home-manager.users."${user.name}";
in
{
home-manager.users."${user.name}" = {
theme.enable = true;
wayland.windowManager.hyprland = {
initExtraConfig = ''
${hmConfig.theme.pkg}/bin/theme &
'';
settings.bind = [
"CTRL_ALT, r, exec, ${hmConfig.theme.pkg}/bin/theme"
"CTRL_ALT, t, exec, ${hmConfig.theme.pkg}/bin/theme toggle"
];
};
home = {
activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] ''
run ${hmConfig.theme.pkg}/bin/theme
'';
persistence."/persist${user.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ];
};
};
}