mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 11:19:47 +01:00
wpaperd: add wpaperd configuration
Signed-off-by: Avimitin <dev@avimit.in>
This commit is contained in:
parent
891a12fa7f
commit
00a599717b
8 changed files with 98 additions and 0 deletions
|
@ -19,6 +19,12 @@
|
|||
githubId = 56743515;
|
||||
name = "Morgane Austreelis";
|
||||
};
|
||||
Avimitin = {
|
||||
name = "Avimitin";
|
||||
email = "dev@avimit.in";
|
||||
github = "Avimitin";
|
||||
githubId = 30021675;
|
||||
};
|
||||
blmhemu = {
|
||||
name = "blmhemu";
|
||||
email = "19410501+blmhemu@users.noreply.github.com";
|
||||
|
|
|
@ -1244,6 +1244,13 @@ in
|
|||
A new module is available: 'programs.awscli'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2023-10-01T07:23:26+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.wpaperd'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -224,6 +224,7 @@ let
|
|||
./programs/wezterm.nix
|
||||
./programs/wlogout.nix
|
||||
./programs/wofi.nix
|
||||
./programs/wpaperd.nix
|
||||
./programs/xmobar.nix
|
||||
./programs/xplr.nix
|
||||
./programs/yazi.nix
|
||||
|
|
49
modules/programs/wpaperd.nix
Normal file
49
modules/programs/wpaperd.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -196,6 +196,7 @@ import nmt {
|
|||
./modules/programs/waybar
|
||||
./modules/programs/wlogout
|
||||
./modules/programs/wofi
|
||||
./modules/programs/wpaperd
|
||||
./modules/programs/xmobar
|
||||
./modules/programs/yt-dlp
|
||||
./modules/services/avizo
|
||||
|
|
1
tests/modules/programs/wpaperd/default.nix
Normal file
1
tests/modules/programs/wpaperd/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ wpaperd-example-settings = ./wpaperd-example-settings.nix; }
|
26
tests/modules/programs/wpaperd/wpaperd-example-settings.nix
Normal file
26
tests/modules/programs/wpaperd/wpaperd-example-settings.nix
Normal 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}
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
[DP-2]
|
||||
path = "/home/foo/Pictures/Anime"
|
||||
sorting = "descending"
|
||||
|
||||
[eDP-1]
|
||||
apply-shadow = true
|
||||
path = "/home/foo/Pictures/Wallpaper"
|
Loading…
Reference in a new issue