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} + '') + ]; + }) + ]; }