1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 11:39:46 +01:00
home-manager/modules/programs/wpaperd.nix
Avimitin 209a24dff2
wpaperd: add wpaperd configuration
Signed-off-by: Avimitin <dev@avimit.in>
2023-10-01 09:23:33 +02:00

49 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.wpaperd;
tomlFormat = pkgs.formats.toml { };
in {
meta.maintainers = [ hm.maintainers.Avimitin ];
options.programs.wpaperd = {
enable = mkEnableOption "wpaperd";
package = mkPackageOption pkgs "wpaperd" { };
settings = mkOption {
type = tomlFormat.type;
default = { };
example = literalExpression ''
{
eDP-1 = {
path = "/home/foo/Pictures/Wallpaper";
apply-shadow = true;
};
DP-2 = {
path = "/home/foo/Pictures/Anime";
sorting = "descending";
};
}
'';
description = ''
Configuration written to
{file}`$XDG_CONFIG_HOME/wpaperd/wallpaper.toml`.
See <https://github.com/danyspin97/wpaperd#wallpaper-configuration>
for the full list of options.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile = {
"wpaperd/wallpaper.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "wpaperd-wallpaper" cfg.settings;
};
};
};
}