helm/modules/themes/options.nix

28 lines
779 B
Nix
Raw Normal View History

2020-01-17 01:22:50 -08:00
# modules/themes/options.nix
2020-01-12 15:17:17 -08:00
2020-01-17 01:22:50 -08:00
{ options, config, lib, pkgs, ... }:
2020-01-12 15:17:17 -08:00
with lib;
{
options.theme = {
wallpaper = mkOption {
type = with types; nullOr (either str path);
};
# TODO Colors?
};
config = {
my.home.home.file.".background-image".source = config.theme.wallpaper;
services.xserver.displayManager.lightdm.background =
let blurredWallpaper =
with pkgs; runCommand "blurWallpaper"
{ buildInputs = [ imagemagick ]; } ''
mkdir "$out"
convert -gaussian-blur 0x2 -modulate 70 -level 5% \
${config.theme.wallpaper} $out/wallpaper.blurred.png
'';
in mkIf (config.theme.wallpaper != null)
"${blurredWallpaper}/wallpaper.blurred.png";
};
}