kiosk/kiosk.nix

38 lines
847 B
Nix

{ pkgs, lib, ... }:
let
dashboardUrl = "https://night.purduehackers.com";
in
{
# Create user to host kiosk
users.users.kiosk = {
isNormalUser = true;
group = "kiosk";
home = "/tmp/kiosk";
};
users.groups.kiosk = { };
# Setup caged kiosk, with kiosk firefox
services.cage = {
enable = true;
user = "kiosk";
program = ''
${lib.getExe pkgs.firefox} \
--kiosk \
--private-window "${dashboardUrl}"
'';
extraArguments = [ "-d" ];
};
# Set firefox autoplay policy to always allow autoplay for dashboard
programs.firefox.policies = {
Permissions.Autoplay.Allow = [ dashboardUrl ];
DontCheckDefaultBrowser = true;
};
# Enable pipewire/pipewire-pulse for audio
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
};
}