summaryrefslogtreecommitdiff
path: root/sys/kiosk/default.nix
blob: b45073322dc2f0acc6c1ccddbe858af0097a337f (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
{ config, lib, ... }:
with lib; let
  cfg = config.local.kiosk;
in
{
  options.local.kiosk = {
    enable = mkEnableOption "kiosk mode";

    program = mkOption {
      type = types.str;
    };

    user = mkOption {
      type = types.str;
    };

    allowVTSwitch = mkOption {
      type = types.bool;
      default = false;
    };
  };

  config = mkIf cfg.enable {
    services = {
      cage = {
        enable = true;
        inherit (cfg) program user;

        extraArguments = [ (if cfg.allowVTSwitch then "-sd" else "-d") ];
      };

      physlock = {
        enable = true;
        disableSysRq = true;
        muteKernelMessages = true;
      };
    };
  };
}