kiosk/kiosk.nix

57 lines
1.3 KiB
Nix
Raw Normal View History

2024-11-15 18:26:11 -05:00
{ pkgs, lib, ... }:
let
dashboardUrl = "https://night.purduehackers.com";
in
{
# Create user to host kiosk
users.users.kiosk = {
2024-11-15 18:39:35 -05:00
isNormalUser = true;
2024-11-15 18:26:11 -05:00
group = "kiosk";
2024-11-15 18:39:35 -05:00
home = "/tmp/kiosk";
2024-11-15 18:26:11 -05:00
};
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
# and disable checking for default browser
2024-11-15 18:26:11 -05:00
programs.firefox.policies = {
Permissions.Autoplay.Default = "allow-audio-video";
Preferences."browser.shell.checkDefaultBrowser".Value = false;
2024-12-07 17:00:08 -05:00
DontCheckDefaultBrowser = true;
2024-11-15 18:26:11 -05:00
};
# Enable pipewire/pipewire-pulse for audio
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
};
2024-12-07 18:28:24 -05:00
services.tailscale = {
enable = true;
extraUpFlags = [ "--advertise-tags" "tag:kiosk" ];
authKeyFile = ./tailscale-client-secret.key;
authKeyParameters.ephemeral = false;
openFirewall = true;
};
networking.firewall.trustedInterfaces = [ "tailscale0" ];
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "yes";
};
};
2024-11-15 18:26:11 -05:00
}