wew lad
This commit is contained in:
commit
d78da97be7
35 changed files with 6762 additions and 0 deletions
84
modules/kiosk.nix
Normal file
84
modules/kiosk.nix
Normal file
|
@ -0,0 +1,84 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.kiosk;
|
||||
in
|
||||
{
|
||||
options.services.kiosk = {
|
||||
enable = mkEnableOption "Enable simple kiosk display";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "root";
|
||||
description = "The user to run the kiosk under";
|
||||
};
|
||||
|
||||
cursor = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Allow a cursor";
|
||||
};
|
||||
|
||||
session = mkOption {
|
||||
type = types.lines;
|
||||
default = "${pkgs.kitty}/bin/kitty ${pkgs.htop}/bin/htop";
|
||||
description = "The session script to run for the kiosk";
|
||||
};
|
||||
|
||||
wayland = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Use wayland instead of xserver";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.cage = mkIf cfg.wayland {
|
||||
enable = true;
|
||||
user = cfg.user;
|
||||
program = cfg.session;
|
||||
# TODO cursor
|
||||
};
|
||||
|
||||
services.xserver = mkIf (!cfg.wayland) {
|
||||
enable = true;
|
||||
|
||||
windowManager.ratpoison.enable = true;
|
||||
|
||||
monitorSection = ''
|
||||
Option "NODPMS"
|
||||
'';
|
||||
|
||||
serverLayoutSection = ''
|
||||
Option "BlankTime" "0"
|
||||
Option "DPMS" "false"
|
||||
'';
|
||||
|
||||
displayManager.lightdm = {
|
||||
enable = true;
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "${cfg.user}";
|
||||
};
|
||||
};
|
||||
|
||||
displayManager.xserverArgs = if cfg.cursor then [ ] else [ "-nocursor" ];
|
||||
displayManager.defaultSession = "kiosk+ratpoison";
|
||||
|
||||
desktopManager.session = [
|
||||
{
|
||||
name = "kiosk";
|
||||
start = ''
|
||||
# dont blank the screen after 5min
|
||||
xset dpms force on
|
||||
xset -dpms
|
||||
xset s noblank
|
||||
xset s off
|
||||
|
||||
${cfg.session}
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue