1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00
nixos/users/ellmau/background-x.nix

35 lines
791 B
Nix

{
config,
pkgs,
lib,
nixosConfig,
...
}:
with lib; {
config = let
cfg = nixosConfig.elss.graphical.xserver;
fehArgs = "--bg-fill --no-fehbg";
in
mkIf cfg.enable {
systemd.user = {
services = {
desktop-background = {
Unit = {
Description = "Set desktop background";
Documentation = ["man:feh(1)"];
After = ["graphical-session-pre.target"];
ParOf = ["graphical-session.target"];
};
Service = {
type = "oneshot";
ExecStart = "${pkgs.feh}/bin/feh ${fehArgs} ${config.xdg.configHome}/background.png";
};
Install = {WantedBy = ["graphical-session.target"];};
};
};
};
};
}