1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-20 23:30:07 +00:00

swww: add swww service module for swww-daemon (#6543)

This commit is contained in:
Yiheng He 2025-03-19 03:32:10 +08:00 committed by GitHub
parent fb74bb76d9
commit 22a36aa709
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 72 additions and 0 deletions

View file

@ -130,6 +130,14 @@
githubId = "56848082";
name = "Henri Sota";
};
hey2022 = {
name = "Yiheng He";
email = "yiheng.he@proton.me";
matrix = "@hey2022:matrix.org";
github = "hey2022";
keys =
[{ fingerprint = "128E 09C0 6F73 D678 6BB5 E551 5EA5 3C75 F7BE 3EDE"; }];
};
jack5079 = {
name = "Jack W.";
email = "nix@jack.cab";

View file

@ -394,6 +394,7 @@ let
./services/swayidle.nix
./services/swaync.nix
./services/swayosd.nix
./services/swww.nix
./services/sxhkd.nix
./services/syncthing.nix
./services/systembus-notify.nix

37
modules/services/swww.nix Normal file
View file

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
let cfg = config.services.swww;
in {
meta.maintainers = with lib.hm.maintainers; [ hey2022 ];
options.services.swww = {
enable =
lib.mkEnableOption "swww, a Solution to your Wayland Wallpaper Woes";
package = lib.mkPackageOption pkgs "swww" { };
};
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.swww" pkgs
lib.platforms.linux)
];
home.packages = [ cfg.package ];
systemd.user.services.swww = {
Install = { WantedBy = [ config.wayland.systemd.target ]; };
Unit = {
ConditionEnvironment = "WAYLAND_DISPLAY";
Description = "swww-daemon";
After = [ config.wayland.systemd.target ];
PartOf = [ config.wayland.systemd.target ];
};
Service = {
ExecStart = "${lib.getExe' cfg.package "swww-daemon"}";
Restart = "always";
RestartSec = 10;
};
};
};
}

View file

@ -528,6 +528,7 @@ in import nmtSrc {
./modules/services/swayidle
./modules/services/swaync
./modules/services/swayosd
./modules/services/swww
./modules/services/sxhkd
./modules/services/syncthing/linux
./modules/services/tldr-update

View file

@ -0,0 +1 @@
{ swww-graphical-session-target = ./swww-graphical-session-target.nix; }

View file

@ -0,0 +1,11 @@
{ config, ... }: {
services.swww = {
enable = true;
package = config.lib.test.mkStubPackage { outPath = "@swww@"; };
};
nmt.script = ''
serviceFile=home-files/.config/systemd/user/swww.service
assertFileContent $serviceFile ${./swww-graphical-session-target.service}
'';
}

View file

@ -0,0 +1,13 @@
[Install]
WantedBy=graphical-session.target
[Service]
ExecStart=@swww@/bin/swww-daemon
Restart=always
RestartSec=10
[Unit]
After=graphical-session.target
ConditionEnvironment=WAYLAND_DISPLAY
Description=swww-daemon
PartOf=graphical-session.target