Fix theme init

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-02-20 15:41:27 +00:00
parent eadbccf2fa
commit 75a0a59c3d

View File

@@ -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;