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

38 lines
1009 B
Nix

{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }:
let
hmConfig = config.home-manager.users.${user.name};
in
{
home-manager.users.${user.name} = {
home = {
packages = with pkgs; [ swww ];
persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ];
};
wayland.windowManager.hyprland.initExtraConfig = "${lib.meta.getExe (pkgs.writeShellApplication {
name = "init-swww";
runtimeInputs = with pkgs; [ swww ];
text = ''
swww-daemon &> /tmp/swww.log
while ! swww query &> /dev/null; do
sleep 0.1
done
swww img "${hmConfig.theme.configDir}/wallpaper"
'';
})} &";
theme.extraConfig = lib.mkAfter "${lib.meta.getExe (pkgs.writeShellApplication {
name = "theme-swww";
runtimeInputs = with pkgs; [
coreutils-full
procps
swww
];
text = "swww img \"${hmConfig.theme.configDir}/wallpaper\"";
})} &";
};
}