23
23
24
24
module = { config , lib , pkgs , ... } :
25
25
let
26
+ sessionName = "kiosk-browser" ;
27
+
26
28
selectDisplay = pkgs . writeShellApplication {
27
29
name = "select-display" ;
28
30
runtimeInputs = with pkgs ; [
41
43
./application/limit-vtes.nix
42
44
] ;
43
45
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
+
44
58
# Kiosk runs as a non-privileged user
45
59
users . users . play = {
46
60
isNormalUser = true ;
64
78
# System-wide packages
65
79
environment . systemPackages = with pkgs ; [ breeze-contrast-cursor-theme ] ;
66
80
81
+ # Avoid bloating system image size
82
+ services . speechd . enable = false ;
83
+
67
84
# Kiosk session
68
- services . xserver = let sessionName = "kiosk-browser" ;
69
- in {
85
+ services . xserver = {
70
86
enable = true ;
71
87
72
88
desktopManager = {
@@ -103,27 +119,28 @@ rec {
103
119
} ;
104
120
105
121
displayManager = {
106
- # Always automatically log in play user
107
122
lightdm = {
108
123
enable = true ;
109
124
greeter . enable = false ;
110
125
autoLogin . timeout = 0 ;
111
126
} ;
112
127
113
- autoLogin = {
114
- enable = true ;
115
- user = "play" ;
116
- } ;
117
-
118
- defaultSession = sessionName ;
119
-
120
128
sessionCommands = ''
121
129
${ pkgs . xorg . xrdb } /bin/xrdb -merge <<EOF
122
130
Xcursor.theme: ${ pkgs . breeze-contrast-cursor-theme . themeName }
123
131
EOF
124
132
'' ;
125
133
} ;
126
134
} ;
135
+ services . displayManager = {
136
+ # Always automatically log in play user
137
+ autoLogin = {
138
+ enable = true ;
139
+ user = "play" ;
140
+ } ;
141
+
142
+ defaultSession = sessionName ;
143
+ } ;
127
144
128
145
# Firewall configuration
129
146
networking . firewall = {
@@ -166,15 +183,16 @@ rec {
166
183
} ;
167
184
168
185
# Audio
169
- sound . enable = true ;
186
+ services . pipewire . enable = false ;
187
+
170
188
hardware . pulseaudio = {
171
189
enable = true ;
172
190
extraConfig = ''
173
191
# Use HDMI output
174
192
set-card-profile 0 output:hdmi-stereo
175
193
# Respond to changes in connected outputs
176
194
load-module module-switch-on-port-available
177
- load-module module-switch-on-connect
195
+ load-module module-switch-on-connect blacklist=""
178
196
'' ;
179
197
} ;
180
198
@@ -183,8 +201,6 @@ rec {
183
201
184
202
# Enable pcscd for smart card identification
185
203
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" ] ;
188
204
# Allow play user to access pcsc
189
205
security . polkit . extraConfig = ''
190
206
polkit.addRule(function(action, subject) {
0 commit comments