Files
nix/users/configs/theme/default.nix
2024-07-02 19:30:22 +03:00

22 lines
644 B
Nix

{ user ? throw "user argument is required" }: { config, inputs, lib, pkgs, ... }:
let
hmConfig = config.home-manager.users.${user.name};
themeBin = lib.meta.getExe hmConfig.theme.pkg;
in
{
home-manager.users.${user.name} = {
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${user.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ];
};
};
}