2024-11-16 04:43:59 +03:00
|
|
|
# Download the wallpaper here.
|
2025-01-01 13:57:05 +03:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-12-18 09:40:11 +03:00
|
|
|
let
|
2025-01-01 13:57:05 +03:00
|
|
|
cfg = config.module.wallpaper;
|
2024-12-30 05:35:15 +03:00
|
|
|
|
2025-01-01 14:30:16 +03:00
|
|
|
url = "https://preview.redd.it/d8oy5ye2vqyd1.gif?width=640&format=mp4&s=a00152d10d85859a688b8b4b12b9cf097f1cdb9b";
|
|
|
|
sha256 = "sha256-k1wS1v/dcXihJA9vk9LXALodAWaQgQxkqfLZY7yugmA=";
|
2024-12-30 05:35:15 +03:00
|
|
|
|
2025-01-01 13:57:05 +03:00
|
|
|
# Use video.
|
|
|
|
video = true;
|
2024-12-30 05:35:15 +03:00
|
|
|
|
2025-01-01 13:57:05 +03:00
|
|
|
# Forse black and white for text.
|
|
|
|
forceContrastText = false;
|
2024-12-30 05:35:15 +03:00
|
|
|
|
2025-01-01 13:57:05 +03:00
|
|
|
# Predefined scheme instead of generated.
|
|
|
|
# SEE: /etc/stylix/palette.json
|
|
|
|
# SEE: https://github.com/tinted-theming/schemes
|
2024-12-30 05:35:15 +03:00
|
|
|
# scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
|
2024-12-30 05:14:17 +03:00
|
|
|
scheme = null;
|
2025-01-01 13:57:05 +03:00
|
|
|
|
|
|
|
# Extract image from video.
|
|
|
|
videoImage =
|
|
|
|
if video then
|
|
|
|
pkgs.runCommandNoCC "wallpaper-video-image" { } ''
|
2025-01-01 14:30:16 +03:00
|
|
|
${pkgs.ffmpeg}/bin/ffmpeg -hide_banner -loglevel error -ss 00:00:00 -i ${cfg.videoPath} -frames:v 1 -q:v 1 Image.jpg
|
2025-01-01 13:57:05 +03:00
|
|
|
cp Image.jpg $out
|
|
|
|
''
|
|
|
|
else
|
|
|
|
null;
|
2024-12-18 09:40:11 +03:00
|
|
|
in
|
2024-11-04 04:37:29 +03:00
|
|
|
{
|
2024-12-18 09:40:11 +03:00
|
|
|
options.module.wallpaper = {
|
|
|
|
forceContrastText = lib.mkOption {
|
|
|
|
default = lib.warnIf forceContrastText "Wallpaper: Forced text contrast." forceContrastText;
|
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
|
|
|
path = lib.mkOption {
|
2025-01-01 13:57:05 +03:00
|
|
|
default = if video then videoImage else pkgs.fetchurl { inherit url sha256; };
|
2024-12-18 09:40:11 +03:00
|
|
|
type = lib.types.path;
|
|
|
|
};
|
2025-01-01 13:57:05 +03:00
|
|
|
video = lib.mkOption {
|
|
|
|
default = video;
|
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
|
|
|
videoPath = lib.mkOption {
|
|
|
|
default = if video then pkgs.fetchurl { inherit url sha256; } else null;
|
|
|
|
type = with lib.types; nullOr path;
|
|
|
|
};
|
2024-12-30 05:14:17 +03:00
|
|
|
scheme = lib.mkOption {
|
|
|
|
default = scheme;
|
|
|
|
type =
|
|
|
|
with lib.types;
|
|
|
|
nullOr (oneOf [
|
|
|
|
path
|
|
|
|
lines
|
|
|
|
attrs
|
|
|
|
]);
|
|
|
|
};
|
2024-12-18 09:40:11 +03:00
|
|
|
};
|
2024-11-04 04:37:29 +03:00
|
|
|
}
|