give kiosk user a home directory
This commit is contained in:
parent
9103bfa337
commit
66e01ab6f9
2 changed files with 4 additions and 13 deletions
2
base.nix
2
base.nix
|
@ -10,6 +10,8 @@
|
||||||
# STOP TRYING TO GIVE IT TO ME
|
# STOP TRYING TO GIVE IT TO ME
|
||||||
boot.supportedFilesystems.zfs = lib.mkForce false;
|
boot.supportedFilesystems.zfs = lib.mkForce false;
|
||||||
|
|
||||||
|
boot.tmp.useTmpfs = true;
|
||||||
|
|
||||||
# Set root password to a secure password
|
# Set root password to a secure password
|
||||||
users.users.root.password = "asecurepassword";
|
users.users.root.password = "asecurepassword";
|
||||||
|
|
||||||
|
|
15
kiosk.nix
15
kiosk.nix
|
@ -5,35 +5,24 @@ in
|
||||||
{
|
{
|
||||||
# Create user to host kiosk
|
# Create user to host kiosk
|
||||||
users.users.kiosk = {
|
users.users.kiosk = {
|
||||||
isSystemUser = true;
|
isNormalUser = true;
|
||||||
group = "kiosk";
|
group = "kiosk";
|
||||||
|
home = "/tmp/kiosk";
|
||||||
};
|
};
|
||||||
users.groups.kiosk = { };
|
users.groups.kiosk = { };
|
||||||
|
|
||||||
# Setup caged kiosk, with kiosk firefox
|
# Setup caged kiosk, with kiosk firefox
|
||||||
# Use a temporary directory for the firefox profile
|
|
||||||
# This removes the need for a home directory at all
|
|
||||||
# Using a private window removes most effects of a profile anyways
|
|
||||||
services.cage = {
|
services.cage = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "kiosk";
|
user = "kiosk";
|
||||||
program = ''
|
program = ''
|
||||||
${lib.getExe pkgs.firefox} \
|
${lib.getExe pkgs.firefox} \
|
||||||
--profile /tmp/firefox-profile \
|
|
||||||
--kiosk \
|
--kiosk \
|
||||||
--private-window "${dashboardUrl}"
|
--private-window "${dashboardUrl}"
|
||||||
'';
|
'';
|
||||||
extraArguments = [ "-d" ];
|
extraArguments = [ "-d" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Create temporary directory for firefox profile
|
|
||||||
systemd.tmpfiles.settings."10-kiosk" = {
|
|
||||||
"/tmp/firefox-profile".d = {
|
|
||||||
user = "kiosk";
|
|
||||||
group = "kiosk";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Set firefox autoplay policy to always allow autoplay for dashboard
|
# Set firefox autoplay policy to always allow autoplay for dashboard
|
||||||
programs.firefox.policies = {
|
programs.firefox.policies = {
|
||||||
Permissions.Autoplay.Allow = [ dashboardUrl ];
|
Permissions.Autoplay.Allow = [ dashboardUrl ];
|
||||||
|
|
Loading…
Reference in a new issue