2323
2424 module = { config , lib , pkgs , ... } :
2525 let
26+ sessionName = "kiosk-browser" ;
27+
2628 selectDisplay = pkgs . writeShellApplication {
2729 name = "select-display" ;
2830 runtimeInputs = with pkgs ; [
4143 ./application/limit-vtes.nix
4244 ] ;
4345
46+ boot . blacklistedKernelModules = [
47+ # Blacklist NFC modules conflicting with CCID/PCSC
48+ # https://ludovicrousseau.blogspot.com/2013/11/linux-nfc-driver-conflicts-with-ccid.html
49+ "pn533_usb"
50+ "pn533"
51+ "nfc"
52+
53+ # Disable any USB sound cards to create a closed world where the audio
54+ # landscape on the standard devices is completely predictable.
55+ "snd_usb_audio"
56+ ] ;
57+
4458 # Kiosk runs as a non-privileged user
4559 users . users . play = {
4660 isNormalUser = true ;
6478 # System-wide packages
6579 environment . systemPackages = with pkgs ; [ breeze-contrast-cursor-theme ] ;
6680
81+ # Avoid bloating system image size
82+ services . speechd . enable = false ;
83+
6784 # Kiosk session
68- services . xserver = let sessionName = "kiosk-browser" ;
69- in {
85+ services . xserver = {
7086 enable = true ;
7187
7288 desktopManager = {
@@ -103,27 +119,28 @@ rec {
103119 } ;
104120
105121 displayManager = {
106- # Always automatically log in play user
107122 lightdm = {
108123 enable = true ;
109124 greeter . enable = false ;
110125 autoLogin . timeout = 0 ;
111126 } ;
112127
113- autoLogin = {
114- enable = true ;
115- user = "play" ;
116- } ;
117-
118- defaultSession = sessionName ;
119-
120128 sessionCommands = ''
121129 ${ pkgs . xorg . xrdb } /bin/xrdb -merge <<EOF
122130 Xcursor.theme: ${ pkgs . breeze-contrast-cursor-theme . themeName }
123131 EOF
124132 '' ;
125133 } ;
126134 } ;
135+ services . displayManager = {
136+ # Always automatically log in play user
137+ autoLogin = {
138+ enable = true ;
139+ user = "play" ;
140+ } ;
141+
142+ defaultSession = sessionName ;
143+ } ;
127144
128145 # Firewall configuration
129146 networking . firewall = {
@@ -166,15 +183,16 @@ rec {
166183 } ;
167184
168185 # Audio
169- sound . enable = true ;
186+ services . pipewire . enable = false ;
187+
170188 hardware . pulseaudio = {
171189 enable = true ;
172190 extraConfig = ''
173191 # Use HDMI output
174192 set-card-profile 0 output:hdmi-stereo
175193 # Respond to changes in connected outputs
176194 load-module module-switch-on-port-available
177- load-module module-switch-on-connect
195+ load-module module-switch-on-connect blacklist=""
178196 '' ;
179197 } ;
180198
@@ -183,8 +201,6 @@ rec {
183201
184202 # Enable pcscd for smart card identification
185203 services . pcscd . enable = true ;
186- # Blacklist NFC modules conflicting with CCID (https://ludovicrousseau.blogspot.com/2013/11/linux-nfc-driver-conflicts-with-ccid.html)
187- boot . blacklistedKernelModules = [ "pn533_usb" "pn533" "nfc" ] ;
188204 # Allow play user to access pcsc
189205 security . polkit . extraConfig = ''
190206 polkit.addRule(function(action, subject) {
0 commit comments