mirror of
https://github.com/nix-community/home-manager
synced 2024-12-18 07:49:48 +01:00
hyprpaper: add module
This commit is contained in:
parent
c6ddd80fb1
commit
223743313b
7 changed files with 142 additions and 0 deletions
|
@ -1629,6 +1629,19 @@ in {
|
||||||
locking utility. See https://github.com/hyprwm/hyprlock for more.
|
locking utility. See https://github.com/hyprwm/hyprlock for more.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2024-05-10T13:35:19+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.hyprpaper'.
|
||||||
|
|
||||||
|
Hyprpaper is a blazing fast wallpaper utility for Hyprland with the
|
||||||
|
ability to dynamically change wallpapers through sockets. It will work
|
||||||
|
on all wlroots-based compositors, though. See
|
||||||
|
https://github.com/hyprwm/hyprpaper for more.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,6 +306,7 @@ let
|
||||||
./services/home-manager-auto-upgrade.nix
|
./services/home-manager-auto-upgrade.nix
|
||||||
./services/hound.nix
|
./services/hound.nix
|
||||||
./services/hypridle.nix
|
./services/hypridle.nix
|
||||||
|
./services/hyprpaper.nix
|
||||||
./services/imapnotify.nix
|
./services/imapnotify.nix
|
||||||
./services/kanshi.nix
|
./services/kanshi.nix
|
||||||
./services/kbfs.nix
|
./services/kbfs.nix
|
||||||
|
|
89
modules/services/hyprpaper.nix
Normal file
89
modules/services/hyprpaper.nix
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.services.hyprpaper;
|
||||||
|
in {
|
||||||
|
meta.maintainers = [ maintainers.khaneliman maintainers.fufexan ];
|
||||||
|
|
||||||
|
options.services.hyprpaper = {
|
||||||
|
enable = mkEnableOption "Hyprpaper, Hyprland's wallpaper daemon";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "hyprpaper" { };
|
||||||
|
|
||||||
|
settings = lib.mkOption {
|
||||||
|
type = with lib.types;
|
||||||
|
let
|
||||||
|
valueType = nullOr (oneOf [
|
||||||
|
bool
|
||||||
|
int
|
||||||
|
float
|
||||||
|
str
|
||||||
|
path
|
||||||
|
(attrsOf valueType)
|
||||||
|
(listOf valueType)
|
||||||
|
]) // {
|
||||||
|
description = "Hyprpaper configuration value";
|
||||||
|
};
|
||||||
|
in valueType;
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
hyprpaper configuration written in Nix. Entries with the same key
|
||||||
|
should be written as lists. Variables' and colors' names should be
|
||||||
|
quoted. See <https://wiki.hyprland.org/Hypr-Ecosystem/hyprpaper/> for more examples.
|
||||||
|
'';
|
||||||
|
example = lib.literalExpression ''
|
||||||
|
{
|
||||||
|
ipc = "on";
|
||||||
|
splash = false;
|
||||||
|
splash_offset = 2.0;
|
||||||
|
|
||||||
|
preload =
|
||||||
|
[ "/share/wallpapers/buttons.png" "/share/wallpapers/cat_pacman.png" ];
|
||||||
|
|
||||||
|
wallpaper = [
|
||||||
|
"DP-3,/share/wallpapers/buttons.png"
|
||||||
|
"DP-1,/share/wallpapers/cat_pacman.png"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
importantPrefixes = lib.mkOption {
|
||||||
|
type = with lib.types; listOf str;
|
||||||
|
default = [ "$" ];
|
||||||
|
example = [ "$" ];
|
||||||
|
description = ''
|
||||||
|
List of prefix of attributes to source at the top of the config.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
xdg.configFile."hypr/hyprpaper.conf" = mkIf (cfg.settings != { }) {
|
||||||
|
text = lib.hm.generators.toHyprconf {
|
||||||
|
attrs = cfg.settings;
|
||||||
|
inherit (cfg) importantPrefixes;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.user.services.hyprpaper = {
|
||||||
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||||
|
|
||||||
|
Unit = {
|
||||||
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||||
|
Description = "hyprpaper";
|
||||||
|
After = [ "graphical-session-pre.target" ];
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
X-Restart-Triggers =
|
||||||
|
[ "${config.xdg.configFile."hypr/hyprpaper.conf".source}" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service = {
|
||||||
|
ExecStart = "${getExe cfg.package}";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "10";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -243,6 +243,7 @@ in import nmtSrc {
|
||||||
./modules/services/gromit-mpx
|
./modules/services/gromit-mpx
|
||||||
./modules/services/home-manager-auto-upgrade
|
./modules/services/home-manager-auto-upgrade
|
||||||
./modules/services/hypridle
|
./modules/services/hypridle
|
||||||
|
./modules/services/hyprpaper
|
||||||
./modules/services/imapnotify
|
./modules/services/imapnotify
|
||||||
./modules/services/kanshi
|
./modules/services/kanshi
|
||||||
./modules/services/lieer
|
./modules/services/lieer
|
||||||
|
|
30
tests/modules/services/hyprpaper/basic-configuration.nix
Normal file
30
tests/modules/services/hyprpaper/basic-configuration.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.hyprpaper = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
ipc = "on";
|
||||||
|
splash = false;
|
||||||
|
splash_offset = 2.0;
|
||||||
|
|
||||||
|
preload =
|
||||||
|
[ "/share/wallpapers/buttons.png" "/share/wallpapers/cat_pacman.png" ];
|
||||||
|
|
||||||
|
wallpaper = [
|
||||||
|
"DP-3,/share/wallpapers/buttons.png"
|
||||||
|
"DP-1,/share/wallpapers/cat_pacman.png"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
test.stubs.hyprpaper = { };
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
config=home-files/.config/hypr/hyprpaper.conf
|
||||||
|
clientServiceFile=home-files/.config/systemd/user/hyprpaper.service
|
||||||
|
assertFileExists $config
|
||||||
|
assertFileExists $clientServiceFile
|
||||||
|
assertFileContent $config ${./hyprpaper.conf}
|
||||||
|
'';
|
||||||
|
}
|
1
tests/modules/services/hyprpaper/default.nix
Normal file
1
tests/modules/services/hyprpaper/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ hyprpaper-basic-configuration = ./basic-configuration.nix; }
|
7
tests/modules/services/hyprpaper/hyprpaper.conf
Normal file
7
tests/modules/services/hyprpaper/hyprpaper.conf
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
ipc=on
|
||||||
|
preload=/share/wallpapers/buttons.png
|
||||||
|
preload=/share/wallpapers/cat_pacman.png
|
||||||
|
splash=false
|
||||||
|
splash_offset=2.000000
|
||||||
|
wallpaper=DP-3,/share/wallpapers/buttons.png
|
||||||
|
wallpaper=DP-1,/share/wallpapers/cat_pacman.png
|
Loading…
Reference in a new issue