zaphyra's git: nixfiles

zaphyra's nixfiles

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
{
  resources,
  config,
  lib,
  pkgs,
  ...
}:

{

  options.zpha.programs.shaderbg.enable = lib.mkEnableOption "shaderbg";

  config = lib.mkIf config.zpha.programs.shaderbg.enable {
    users.users.zaphyra.maid = {
      packages = [ pkgs.shaderbg ];

      systemd.services.shaderbg = {
        description = "A live wallpaper program for Sway and other compositors with wlr-layer-shell support.";
        after = [ "niri-session.target" ];
        partOf = [ "niri-session.target" ];
        wantedBy = [ "niri-session.target" ];

        unitConfig.ConditionEnvironment = "WAYLAND_DISPLAY";

        serviceConfig = {
          Restart = "on-failure";
          ExecStart = lib.escapeShellArgs [
            (lib.getExe pkgs.zpha.shaderbg)
            "*"
            resources.shaders.background1
          ];
        };
      };
    };
  };

}