37 lines
994 B
Nix
37 lines
994 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; [
|
|
coreutils-full
|
|
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; [ swww ];
|
|
text = "swww img \"${hmConfig.theme.configDir}/wallpaper\"";
|
|
})} &";
|
|
};
|
|
}
|