1 { config, lib, pkgs, ... }:
6 cfg = config.services.xserver.desktopManager.surf-display;
9 # Surf Kiosk Display: Wrap around surf browser and turn your
10 # system into a browser screen in KIOSK-mode.
12 # default download URI for all display screens if not configured individually
13 DEFAULT_WWW_URI="${cfg.defaultWwwUri}"
15 # Enforce fixed resolution for all displays (default: not set):
16 #DEFAULT_RESOLUTION="1920x1080"
18 # HTTP proxy URL, if needed (default: not set).
19 #HTTP_PROXY_URL="http://webcache:3128"
21 # Setting for internal inactivity timer to restart surf-display
22 # if the user goes inactive/idle.
23 INACTIVITY_INTERVAL="${builtins.toString cfg.inactivityInterval}"
25 # log to syslog instead of .xsession-errors
28 # Launch pulseaudio daemon if not already running.
31 # screensaver settings, see "man 1 xset" for possible options
32 SCREENSAVER_SETTINGS="${cfg.screensaverSettings}"
34 # disable right and middle pointer device click in browser sessions while keeping
35 # scrolling wheels' functionality intact... (consider "pointer" subcommand on
36 # xmodmap man page for details).
37 POINTER_BUTTON_MAP="${cfg.pointerButtonMap}"
39 # Hide idle mouse pointer.
40 HIDE_IDLE_POINTER="${cfg.hideIdlePointer}"
47 services.xserver.desktopManager.surf-display = {
48 enable = mkEnableOption "surf-display as a kiosk browser session";
50 defaultWwwUri = mkOption {
52 default = "${pkgs.surf-display}/share/surf-display/empty-page.html";
53 defaultText = literalExpression ''"''${pkgs.surf-display}/share/surf-display/empty-page.html"'';
54 example = "https://www.example.com/";
55 description = "Default URI to display.";
58 inactivityInterval = mkOption {
63 Setting for internal inactivity timer to restart surf-display if the
64 user goes inactive/idle to get a fresh session for the next user of
67 If this value is set to zero, the whole feature of restarting due to
68 inactivity is disabled.
72 screensaverSettings = mkOption {
73 type = types.separatedString " ";
76 Screensaver settings, see `man 1 xset` for possible options.
80 pointerButtonMap = mkOption {
82 default = "1 0 0 4 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0";
84 Disable right and middle pointer device click in browser sessions
85 while keeping scrolling wheels' functionality intact. See pointer
86 subcommand on `man xmodmap` for details.
90 hideIdlePointer = mkOption {
94 description = "Hide idle mouse pointer.";
97 extraConfig = mkOption {
101 # Enforce fixed resolution for all displays (default: not set):
102 DEFAULT_RESOLUTION="1920x1080"
104 # HTTP proxy URL, if needed (default: not set).
105 HTTP_PROXY_URL="http://webcache:3128"
107 # Configure individual display screens with host specific parameters:
108 DISPLAYS['display-host-0']="www_uri=https://www.displayserver.comany.net/display-1/index.html"
109 DISPLAYS['display-host-1']="www_uri=https://www.displayserver.comany.net/display-2/index.html"
110 DISPLAYS['display-host-2']="www_uri=https://www.displayserver.comany.net/display-3/index.html|res=1920x1280"
111 DISPLAYS['display-host-3']="www_uri=https://www.displayserver.comany.net/display-4/index.html"|res=1280x1024"
112 DISPLAYS['display-host-local-file']="www_uri=file:///usr/share/doc/surf-display/empty-page.html"
115 Extra configuration options to append to `/etc/default/surf-display`.
121 config = mkIf cfg.enable {
122 services.displayManager.sessionPackages = [
126 environment.etc."default/surf-display".text = surfDisplayConf;