mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
swww: add swww service module for swww-daemon (#6543)
This commit is contained in:
parent
fb74bb76d9
commit
22a36aa709
7 changed files with 72 additions and 0 deletions
|
@ -130,6 +130,14 @@
|
||||||
githubId = "56848082";
|
githubId = "56848082";
|
||||||
name = "Henri Sota";
|
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 = {
|
jack5079 = {
|
||||||
name = "Jack W.";
|
name = "Jack W.";
|
||||||
email = "nix@jack.cab";
|
email = "nix@jack.cab";
|
||||||
|
|
|
@ -394,6 +394,7 @@ let
|
||||||
./services/swayidle.nix
|
./services/swayidle.nix
|
||||||
./services/swaync.nix
|
./services/swaync.nix
|
||||||
./services/swayosd.nix
|
./services/swayosd.nix
|
||||||
|
./services/swww.nix
|
||||||
./services/sxhkd.nix
|
./services/sxhkd.nix
|
||||||
./services/syncthing.nix
|
./services/syncthing.nix
|
||||||
./services/systembus-notify.nix
|
./services/systembus-notify.nix
|
||||||
|
|
37
modules/services/swww.nix
Normal file
37
modules/services/swww.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -528,6 +528,7 @@ in import nmtSrc {
|
||||||
./modules/services/swayidle
|
./modules/services/swayidle
|
||||||
./modules/services/swaync
|
./modules/services/swaync
|
||||||
./modules/services/swayosd
|
./modules/services/swayosd
|
||||||
|
./modules/services/swww
|
||||||
./modules/services/sxhkd
|
./modules/services/sxhkd
|
||||||
./modules/services/syncthing/linux
|
./modules/services/syncthing/linux
|
||||||
./modules/services/tldr-update
|
./modules/services/tldr-update
|
||||||
|
|
1
tests/modules/services/swww/default.nix
Normal file
1
tests/modules/services/swww/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ swww-graphical-session-target = ./swww-graphical-session-target.nix; }
|
|
@ -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}
|
||||||
|
'';
|
||||||
|
}
|
|
@ -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
|
Loading…
Add table
Reference in a new issue