22with lib ; let
33 preferenceOpts = _ : {
44 options = {
5- # NOTE: renamed from internal EnabledFolders, since
6- # it makes more sense to call it library not folder
75 enabledLibraries = mkOption {
86 type = types . listOf types . str ;
9- default = [ ] ; # empty means all are enabled
7+ default = [ ] ;
108 description = ''
119 A list of libraries this user as access to.
1210 If it is empty, it means that the user has access to all libraries.
@@ -18,6 +16,26 @@ with lib; let
1816 "Family Photos"
1917 ] ;
2018 } ;
19+
20+ groupedFolders = mkOption {
21+ type = types . listOf types . str ;
22+ default = [ ] ;
23+ } ;
24+
25+ orderedViews = mkOption {
26+ type = types . listOf types . str ;
27+ default = [ ] ;
28+ } ;
29+
30+ latestItemsExcludes = mkOption {
31+ type = types . listOf types . str ;
32+ default = [ ] ;
33+ } ;
34+
35+ myMediaExcludes = mkOption {
36+ type = types . listOf types . str ;
37+ default = [ ] ;
38+ } ;
2139 } ;
2240 } ;
2341 # See: https://github.com/jellyfin/jellyfin/blob/master/src/Jellyfin.Database/Jellyfin.Database.Implementations/Enums/PermissionKind.cs
@@ -144,6 +162,95 @@ with lib; let
144162 default = false ;
145163 description = "Whether the server should force transcoding on remote connections for the user" ;
146164 } ;
165+
166+ maxParentalRating = mkOption {
167+ type = types . nullOr types . int ;
168+ default = null ;
169+ } ;
170+
171+ blockedTags = mkOption {
172+ type = types . listOf types . str ;
173+ default = [ ] ;
174+ } ;
175+
176+ allowedTags = mkOption {
177+ type = types . listOf types . str ;
178+ default = [ ] ;
179+ } ;
180+
181+ blockUnratedItems = mkOption {
182+ type = types . listOf types . str ;
183+ default = [ ] ;
184+ } ;
185+
186+ enabledDevices = mkOption {
187+ type = types . listOf types . str ;
188+ default = [ ] ;
189+ } ;
190+
191+ enabledChannels = mkOption {
192+ type = types . listOf types . str ;
193+ default = [ ] ;
194+ } ;
195+
196+ blockedMediaFolders = mkOption {
197+ type = types . listOf types . str ;
198+ default = [ ] ;
199+ } ;
200+
201+ blockedChannels = mkOption {
202+ type = types . listOf types . str ;
203+ default = [ ] ;
204+ } ;
205+
206+ enableContentDeletionFromFolders = mkOption {
207+ type = types . listOf types . str ;
208+ default = [ ] ;
209+ } ;
210+
211+ accessSchedules = mkOption {
212+ type = types . listOf ( types . submodule {
213+ options = {
214+ dayOfWeek = mkOption {
215+ type = types . enum [
216+ "Sunday"
217+ "Monday"
218+ "Tuesday"
219+ "Wednesday"
220+ "Thursday"
221+ "Friday"
222+ "Saturday"
223+ ] ;
224+ } ;
225+ startHour = mkOption {
226+ type = types . ints . between 0 23 ;
227+ } ;
228+ endHour = mkOption {
229+ type = types . ints . between 0 23 ;
230+ } ;
231+ } ;
232+ } ) ;
233+ default = [ ] ;
234+ } ;
235+
236+ syncPlayAccess = mkOption {
237+ type = types . bool ;
238+ description = "Whether or not this user has access to SyncPlay" ;
239+ example = true ;
240+ default = false ;
241+ } ;
242+
243+ authenticationProviderId = mkOption {
244+ type = types . str ;
245+ default = "Jellyfin.Server.Implementations.Users.DefaultAuthenticationProvider" ;
246+ description = "Authentication provider ID" ;
247+ } ;
248+
249+ passwordResetProviderId = mkOption {
250+ type = types . str ;
251+ default = "Jellyfin.Server.Implementations.Users.DefaultPasswordResetProvider" ;
252+ description = "Password reset provider ID" ;
253+ } ;
147254 } ;
148255 } ;
149256 userOpts = _ : {
@@ -160,8 +267,8 @@ with lib; let
160267 ] ;
161268 } ;
162269 } ;
163- permissions = mkOption {
164- description = "Permissions for this user" ;
270+ policy = mkOption {
271+ description = "Policy for this user" ;
165272 default = { } ;
166273 type = with types ; submodule permissionOpts ;
167274 example = {
@@ -181,6 +288,10 @@ with lib; let
181288 and no nix configuration changes will have any effect.
182289 If false however, all options are overwritten as specified in the nix configuration,
183290 which means any change through the Jellyfin GUI will have no effect after a rebuild.
291+
292+ Note: Passwords are only set during user creation and are never updated
293+ declaratively, regardless of the mutable setting. To change a user's password,
294+ use the Jellyfin web interface.
184295 '' ;
185296 default = true ;
186297 } ;
@@ -262,24 +373,10 @@ with lib; let
262373 type = with types ; nullOr int ;
263374 default = null ;
264375 } ;
265- hashedPassword = mkOption {
266- type = types . nullOr types . str ;
267- default = null ;
268- description = ''
269- A pbkdf2-sha512 hash of the user password.
270- Generate using: nix run github:kiriwalawren/nixflix#genhash -- -k <password> -i 210000 -l 128 -u
271- '' ;
272- example = "$PBKDF2-SHA512$iterations=210000$D12C02D1DD15949D867BCA9971BE9987$67E75CDCD14E7F6FDDF96BAACBE9E84E5197FB9FE454FB039F5CD773D7DF558B57DC81DB42B6F7CF0E6B8207A771E5C0EE0DBFD91CE5BAF804FE53F70E61CD2E" ;
273- } ;
274- hashedPasswordFile = mkOption {
376+ passwordFile = mkOption {
275377 type = types . nullOr types . path ;
276378 description = ''
277- Path to a file containing a pbkdf2-sha512 hash in PHC string format.
278- Generate using: nix run github:kiriwalawren/nixflix#genhash -- -k <password> -i 210000 -l 128 -u > /path/to/hash
279- '' ;
280- example = ''
281- # the format is: $<id>[$<param>=<value>(,<param>=<value>)*][$<salt>[$<hash>]]
282- $PBKDF2-SHA512$iterations=210000$D12C02D1DD15949D867BCA9971BE9987$67E75CDCD14E7F6FDDF96BAACBE9E84E5197FB9FE454FB039F5CD773D7DF558B57DC81DB42B6F7CF0E6B8207A771E5C0EE0DBFD91CE5BAF804FE53F70E61CD2E
379+ Path to a file containing the user's password in plain text.
283380 '' ;
284381 default = null ;
285382 } ;
@@ -329,13 +426,6 @@ with lib; let
329426 '' ;
330427 default = "default" ;
331428 } ;
332- syncPlayAccess = mkOption {
333- type = types . bool ;
334- description = "Whether or not this user has access to SyncPlay" ;
335- example = true ;
336- default = false ;
337- } ;
338- # Something to do with chromecast, don't know tbh
339429 castReceiverId = mkOption {
340430 type = types . str ;
341431 default = "F007D354" ;
0 commit comments