aboutsummaryrefslogtreecommitdiff
path: root/modules/services/xembed-sni-proxy.nix
blob: ff63d108b77402bd40879dcf85a1a4148e6f7d0d (plain)
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
38
39
40
41
42
43
44
45
{ config, lib, pkgs, ... }:

with lib;

let

  cfg = config.services.xembed-sni-proxy;

in {
  meta.maintainers = [ maintainers.rycee ];

  options = {
    services.xembed-sni-proxy = {
      enable = mkEnableOption "XEmbed SNI Proxy";

      package = mkOption {
        type = types.package;
        default = pkgs.plasma-workspace;
        defaultText = literalExample "pkgs.plasma-workspace";
        description = ''
          Package containing the <command>xembedsniproxy</command>
          program.
        '';
      };
    };
  };

  config = mkIf cfg.enable {
    systemd.user.services.xembed-sni-proxy = {
      Unit = {
        Description = "XEmbed SNI Proxy";
        After = [ "graphical-session-pre.target" ];
        PartOf = [ "graphical-session.target" ];
      };

      Install = { WantedBy = [ "graphical-session.target" ]; };

      Service = {
        Environment = "PATH=${config.home.profileDirectory}/bin";
        ExecStart = "${cfg.package}/bin/xembedsniproxy";
        Restart = "on-abort";
      };
    };
  };
}