-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
167 changed files
with
969 additions
and
1,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
rec { | ||
fullProductName = "Dividat PlayOS"; | ||
safeProductName = "playos"; | ||
version = "2023.9.0-VALIDATION"; | ||
|
||
greeting = label: '' | ||
_ | ||
, -"" "". | ||
,' ____ `. | ||
,' ,' `. `._ | ||
(`. _..--.._ ,' ,' \\ \\ | ||
(`-.\\ .-"" ""' / ( d _b | ||
(`._ `-"" ,._ ( `-( \\ | ||
<_ ` ( <`< \\ `-._\\ | ||
<`- (__< < : ${label} | ||
(__ (_<_< ; | ||
-----`------------------------------------------------------ ----------- ------- ----- --- -- - | ||
''; | ||
|
||
overlays = [ | ||
(import ./application/overlays version) | ||
# Limit virtual terminals that can be switched to | ||
# Virtual terminal 7 is the kiosk, 8 is the status screen | ||
(import ./application/overlays/xorg { activeVirtualTerminals = [ 7 8 ]; }) | ||
]; | ||
|
||
module = { config, lib, pkgs, ... }: { | ||
|
||
imports = [ ./application/playos-status.nix ]; | ||
|
||
# Kiosk runs as a non-privileged user | ||
users.users.play = { | ||
isNormalUser = true; | ||
home = "/home/play"; | ||
extraGroups = [ | ||
"dialout" # Access to serial ports for the Senso flex | ||
]; | ||
}; | ||
|
||
# Note that setting up "/home" as persistent fails due to https://github.com/NixOS/nixpkgs/issues/6481 | ||
playos.storage.persistentFolders."/home/play" = { | ||
mode = "0700"; | ||
user = "play"; | ||
group = "users"; | ||
}; | ||
|
||
# System-wide packages | ||
environment.systemPackages = with pkgs; [ breeze-contrast-cursor-theme ]; | ||
|
||
# Kiosk session | ||
services.xserver = let sessionName = "kiosk-browser"; | ||
in { | ||
enable = true; | ||
|
||
desktopManager = { | ||
xterm.enable = false; | ||
session = [{ | ||
name = sessionName; | ||
start = '' | ||
# Disable screen-saver control (screen blanking) | ||
xset s off | ||
xset s noblank | ||
xset -dpms | ||
# Localization for xsession | ||
if [ -f /var/lib/gui-localization/lang ]; then | ||
export LANG=$(cat /var/lib/gui-localization/lang) | ||
fi | ||
if [ -f /var/lib/gui-localization/keymap ]; then | ||
setxkbmap $(cat /var/lib/gui-localization/keymap) || true | ||
fi | ||
# Set preferred screen resolution | ||
scaling_pref=$(cat /var/lib/gui-localization/screen-scaling 2>/dev/null || echo "default") | ||
case "$scaling_pref" in | ||
"default" | "full-hd") | ||
xrandr --size 1920x1080;; | ||
"native") | ||
# Nothing to do, let system decide. | ||
;; | ||
*) | ||
echo "Unknown scaling preference '$scaling_pref'. Ignoring." | ||
;; | ||
esac | ||
# Enable Qt WebEngine Developer Tools (https://doc.qt.io/qt-5/qtwebengine-debugging.html) | ||
export QTWEBENGINE_REMOTE_DEBUGGING="127.0.0.1:3355" | ||
${pkgs.playos-kiosk-browser}/bin/kiosk-browser \ | ||
${config.playos.kioskUrl} \ | ||
http://localhost:3333/ | ||
waitPID=$! | ||
''; | ||
}]; | ||
}; | ||
|
||
displayManager = { | ||
# Always automatically log in play user | ||
lightdm = { | ||
enable = true; | ||
greeter.enable = false; | ||
autoLogin.timeout = 0; | ||
}; | ||
|
||
autoLogin = { | ||
enable = true; | ||
user = "play"; | ||
}; | ||
|
||
defaultSession = sessionName; | ||
|
||
sessionCommands = '' | ||
${pkgs.xorg.xrdb}/bin/xrdb -merge <<EOF | ||
Xcursor.theme: ${pkgs.breeze-contrast-cursor-theme.themeName} | ||
EOF | ||
''; | ||
}; | ||
}; | ||
|
||
# Driver service | ||
systemd.services."dividat-driver" = { | ||
description = "Dividat Driver"; | ||
serviceConfig.ExecStart = "${pkgs.dividat-driver}/bin/dividat-driver"; | ||
serviceConfig.User = "play"; | ||
wantedBy = [ "multi-user.target" ]; | ||
}; | ||
|
||
# Audio | ||
sound.enable = true; | ||
hardware.pulseaudio = { | ||
enable = true; | ||
extraConfig = '' | ||
# Use HDMI output | ||
set-card-profile 0 output:hdmi-stereo | ||
# Respond to changes in connected outputs | ||
load-module module-switch-on-port-available | ||
load-module module-switch-on-connect | ||
''; | ||
}; | ||
|
||
# Enable avahi for Senso discovery | ||
services.avahi.enable = true; | ||
|
||
# Enable pcscd for smart card identification | ||
services.pcscd.enable = true; | ||
# Blacklist NFC modules conflicting with CCID (https://ludovicrousseau.blogspot.com/2013/11/linux-nfc-driver-conflicts-with-ccid.html) | ||
boot.blacklistedKernelModules = [ "pn533_usb" "pn533" "nfc" ]; | ||
# Allow play user to access pcsc | ||
security.polkit.extraConfig = '' | ||
polkit.addRule(function(action, subject) { | ||
if (subject.user == "play" && (action.id == "org.debian.pcsc-lite.access_pcsc" || action.id == "org.debian.pcsc-lite.access_card")) { | ||
return polkit.Result.YES; | ||
} | ||
}); | ||
''; | ||
|
||
playos.remoteMaintenance = { | ||
enable = true; | ||
networks = [ "a09acf02330ccc60" ]; | ||
authorizedKeys = [ | ||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDUOwaIpDOHaADuJaS6+bSsEJDvmzRfdkhi8k/infDZimdbSRQvSdbRiRJlPPAeETRaKH8z5eOCJPYLSb3+EHn7oQFsUD6c5Gg+LQAahB/lhja7RoDCPH6/hHaOKYJny5lDfJ+KVSn3fNFiJ0mFJRIjGcoUeI95Rw1PHZJae8ZOapU336Uyy8hB84lvcaFmjzMEIyDkvSxpTrD+RpugG3XJhQE24a6t7fN9z3P6CfprVyFVHA3dkmxAvcYseeXA6TBfIGUbiC3wN1o7GoAgnsiVpwq9q4Ye3jMoRvB3Iw05rvcO/m5WT3JmCAWgeIM1yvWM3Pxc05E7g1jXRaygb0VVk8QendNZt+jlwVVU5N2H+LJ+vw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3BCEAAB" | ||
]; | ||
}; | ||
|
||
# Enable persistent journaling with low maximum size | ||
playos.storage.persistentFolders."/var/log/journal" = { | ||
mode = "0755"; | ||
user = "root"; | ||
group = "root"; | ||
}; | ||
services.journald.extraConfig = '' | ||
Storage=persistent | ||
SystemMaxUse=1G | ||
''; | ||
|
||
# Set a low default timeout when stopping services, to prevent the Windows 95 shutdown experience | ||
systemd.extraConfig = "DefaultTimeoutStopSec=15s"; | ||
|
||
}; | ||
} |
Binary file added
BIN
+405 KB
application/overlays/breeze-contrast-cursor-theme/breeze-contrast-cursor-theme.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: self: super: { | ||
|
||
dividat-driver = (import ./dividat-driver) { | ||
inherit (super) stdenv fetchFromGitHub buildGoModule; | ||
pkgs = self; | ||
}; | ||
|
||
playos-kiosk-browser = import ../../kiosk { | ||
pkgs = self; | ||
system_name = "PlayOS"; | ||
system_version = version; | ||
}; | ||
|
||
breeze-contrast-cursor-theme = super.callPackage ./breeze-contrast-cursor-theme {}; | ||
|
||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.