mirror of
https://github.com/EdenQwQ/nixos.git
synced 2026-02-04 04:03:23 +08:00
18 lines
488 B
Nix
18 lines
488 B
Nix
{
|
|
pkgs,
|
|
config,
|
|
wallpaper,
|
|
}:
|
|
let
|
|
inherit (wallpaper) name path live;
|
|
colors = builtins.concatStringsSep " " config.lib.stylix.colors.toList;
|
|
in
|
|
if live then
|
|
pkgs.runCommand "${name}.gif" { } ''
|
|
${pkgs.lutgen}/bin/lutgen generate -o palette.png -- ${colors}
|
|
${pkgs.ffmpeg}/bin/ffmpeg -i ${path} -i palette.png -filter_complex '[0][1] haldclut' $out
|
|
''
|
|
else
|
|
pkgs.runCommand "${name}.jpg" { } ''
|
|
${pkgs.lutgen}/bin/lutgen apply -o $out ${path} -- ${colors}
|
|
''
|