diff --git a/modules/misc/news.nix b/modules/misc/news.nix index fe48aa1f0..203f52499 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -936,6 +936,14 @@ in A new module is available: 'programs.matplotlib'. ''; } + + { + time = "2019-01-26T13:20:37+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.xembed-sni-proxy'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 1ca4cee50..1a4f3bb5e 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -114,6 +114,7 @@ let (loadModule ./services/window-managers/awesome.nix { }) (loadModule ./services/window-managers/i3.nix { }) (loadModule ./services/window-managers/xmonad.nix { }) + (loadModule ./services/xembed-sni-proxy.nix { condition = hostPlatform.isLinux; }) (loadModule ./services/xscreensaver.nix { }) (loadModule ./systemd.nix { }) (loadModule ./xcursor.nix { }) diff --git a/modules/services/xembed-sni-proxy.nix b/modules/services/xembed-sni-proxy.nix new file mode 100644 index 000000000..0854365da --- /dev/null +++ b/modules/services/xembed-sni-proxy.nix @@ -0,0 +1,49 @@ +{ 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 = "pkgs.plasma-workspace"; + description = '' + Package containing the xembedsniproxy + 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"; + }; + }; + }; +}