1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-26 03:39:47 +01:00

wpaperd: add wpaperd configuration

Signed-off-by: Avimitin <dev@avimit.in>
This commit is contained in:
Avimitin 2023-09-28 10:47:55 +08:00 committed by Mikilio
parent 891a12fa7f
commit 00a599717b
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F
8 changed files with 98 additions and 0 deletions

View file

@ -19,6 +19,12 @@
githubId = 56743515; githubId = 56743515;
name = "Morgane Austreelis"; name = "Morgane Austreelis";
}; };
Avimitin = {
name = "Avimitin";
email = "dev@avimit.in";
github = "Avimitin";
githubId = 30021675;
};
blmhemu = { blmhemu = {
name = "blmhemu"; name = "blmhemu";
email = "19410501+blmhemu@users.noreply.github.com"; email = "19410501+blmhemu@users.noreply.github.com";

View file

@ -1244,6 +1244,13 @@ in
A new module is available: 'programs.awscli'. A new module is available: 'programs.awscli'.
''; '';
} }
{
time = "2023-10-01T07:23:26+00:00";
message = ''
A new module is available: 'programs.wpaperd'.
'';
}
]; ];
}; };
} }

View file

@ -224,6 +224,7 @@ let
./programs/wezterm.nix ./programs/wezterm.nix
./programs/wlogout.nix ./programs/wlogout.nix
./programs/wofi.nix ./programs/wofi.nix
./programs/wpaperd.nix
./programs/xmobar.nix ./programs/xmobar.nix
./programs/xplr.nix ./programs/xplr.nix
./programs/yazi.nix ./programs/yazi.nix

View file

@ -0,0 +1,49 @@
{ 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;
};
};
};
}

View file

@ -196,6 +196,7 @@ import nmt {
./modules/programs/waybar ./modules/programs/waybar
./modules/programs/wlogout ./modules/programs/wlogout
./modules/programs/wofi ./modules/programs/wofi
./modules/programs/wpaperd
./modules/programs/xmobar ./modules/programs/xmobar
./modules/programs/yt-dlp ./modules/programs/yt-dlp
./modules/services/avizo ./modules/services/avizo

View file

@ -0,0 +1 @@
{ wpaperd-example-settings = ./wpaperd-example-settings.nix; }

View file

@ -0,0 +1,26 @@
{ ... }:
{
config = {
programs.wpaperd = {
enable = true;
settings = {
eDP-1 = {
path = "/home/foo/Pictures/Wallpaper";
apply-shadow = true;
};
DP-2 = {
path = "/home/foo/Pictures/Anime";
sorting = "descending";
};
};
};
test.stubs.wpaperd = { };
nmt.script = ''
assertFileContent home-files/.config/wpaperd/wallpaper.toml \
${./wpaperd-expected-settings.toml}
'';
};
}

View file

@ -0,0 +1,7 @@
[DP-2]
path = "/home/foo/Pictures/Anime"
sorting = "descending"
[eDP-1]
apply-shadow = true
path = "/home/foo/Pictures/Wallpaper"