diff --git a/hosts/common/configs/user/gui/theme/options.nix b/hosts/common/configs/user/gui/theme/options.nix index 5683028..5fd277d 100644 --- a/hosts/common/configs/user/gui/theme/options.nix +++ b/hosts/common/configs/user/gui/theme/options.nix @@ -8,12 +8,16 @@ let cfg = config.theme; + wallpaper = pkgs.runCommandLocal "wallpaper" { } '' + ln -s ${cfg.wallpaper} $out + ''; + init = pkgs.writeShellApplication { name = "theme-init"; runtimeInputs = with pkgs; [ matugen ]; text = '' [[ ! -d "${cfg.configDir}" ]] && mkdir -p "${cfg.configDir}" - [[ ! -L "${cfg.configDir}"/wallpaper ]] && ln -sf "${cfg.wallpaper}" "${cfg.configDir}"/wallpaper + [[ ! -L "${cfg.configDir}"/wallpaper ]] && ln -sf "${wallpaper}" "${cfg.configDir}"/wallpaper [[ ! -f "${cfg.configDir}"/mode ]] && echo "${cfg.mode}" > "${cfg.configDir}"/mode matugen image "${cfg.configDir}/wallpaper" \ @@ -39,7 +43,7 @@ let runtimeInputs = with pkgs; [ coreutils ]; runtimeEnv = { CONFIG = cfg.configDir; - DEFAULT_WALLPAPER = cfg.wallpaper; + DEFAULT_WALLPAPER = wallpaper; DEFAULT_MODE = cfg.mode; INIT = lib.meta.getExe init; RELOAD = lib.meta.getExe reload;