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;
|
2025-01-04 08:44:19 +03:00
|
|
|
purpose = config.module.purpose;
|
2024-12-30 05:35:15 +03:00
|
|
|
|
2025-01-05 07:28:43 +03:00
|
|
|
# Set the wallpaper here.
|
2025-01-05 07:06:35 +03:00
|
|
|
url = "https://cloud.voronind.com/s/dG9E9sCNaXyPToH/download?path=%2Fvideo&files=ryo-yamada-in-the-snow-bocchi-the-rock-moewalls-com.mp4&downloadStartSecret=blbioqzgn1k";
|
|
|
|
sha256 = "sha256-HLlNcbNxu/Aw1T/WZiCzEwVXN1uhzqQMtJ0tNxQtDw4=";
|
2025-01-01 13:57:05 +03:00
|
|
|
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.
|
2025-01-02 06:43:46 +03:00
|
|
|
videoPath = if video then pkgs.fetchurl { inherit url sha256; } else null;
|
|
|
|
image =
|
2025-01-01 13:57:05 +03:00
|
|
|
if video then
|
|
|
|
pkgs.runCommandNoCC "wallpaper-video-image" { } ''
|
2025-01-02 06:43:46 +03:00
|
|
|
${pkgs.ffmpeg}/bin/ffmpeg -hide_banner -loglevel error -ss 00:00:00 -i ${videoPath} -frames:v 1 -q:v 1 Image.jpg
|
2025-01-05 07:27:40 +03:00
|
|
|
mv Image.jpg $out
|
2025-01-01 13:57:05 +03:00
|
|
|
''
|
|
|
|
else
|
2025-01-02 06:43:46 +03:00
|
|
|
pkgs.fetchurl { inherit url sha256; };
|
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-02 06:43:46 +03:00
|
|
|
default = image;
|
2024-12-18 09:40:11 +03:00
|
|
|
type = lib.types.path;
|
|
|
|
};
|
2025-01-01 13:57:05 +03:00
|
|
|
video = lib.mkOption {
|
2025-01-04 08:44:19 +03:00
|
|
|
default = video && purpose.desktop;
|
2025-01-01 13:57:05 +03:00
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
|
|
|
videoPath = lib.mkOption {
|
2025-01-02 06:43:46 +03:00
|
|
|
default = videoPath;
|
2025-01-01 13:57:05 +03:00
|
|
|
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
|
|
|
}
|