From 3252822100f27c4a8c0060b9a590e50778ce0d19 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 1 Jan 2025 19:06:52 +0300 Subject: [PATCH] Wallpaper: Fix non-video build. --- config/Wallpaper.nix | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/config/Wallpaper.nix b/config/Wallpaper.nix index 678b551..38c9e55 100644 --- a/config/Wallpaper.nix +++ b/config/Wallpaper.nix @@ -1,13 +1,20 @@ -{ config, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.module.wallpaper; in { - config = { - environment.systemPackages = [ - (pkgs.writeShellScriptBin "wallpaper-video" '' - mpvpaper -o 'no-audio --loop-file --panscan=1' '*' ${cfg.videoPath} - '') - ]; - }; + config = lib.mkMerge [ + (lib.mkIf (cfg.videoPath != null) { + environment.systemPackages = [ + (pkgs.writeShellScriptBin "wallpaper-video" '' + mpvpaper -o 'no-audio --loop-file --panscan=1' '*' ${cfg.videoPath} + '') + ]; + }) + ]; }