@ -6,12 +6,6 @@ let
ids = config . ids ;
cfg = config . users ;
isPasswdCompatible = str : ! ( hasInfix " : " str || hasInfix " \n " str ) ;
passwdEntry = type : lib . types . addCheck type isPasswdCompatible // {
name = " p a s s w d E n t r y ${ type . name } " ;
description = " ${ type . description } , n o t c o n t a i n i n g n e w l i n e s o r c o l o n s " ;
} ;
# Check whether a password hash will allow login.
allowsLogin = hash :
hash == " " # login without password
@ -60,7 +54,7 @@ let
options = {
name = mkOption {
type = passwdEntry types . str ;
type = types . passwdEntry types . str ;
apply = x : assert ( builtins . stringLength x < 32 || abort " U s e r n a m e ' ${ x } ' i s l o n g e r t h a n 3 1 c h a r a c t e r s w h i c h i s n o t a l l o w e d ! " ) ; x ;
description = ''
The name of the user account . If undefined , the name of the
@ -69,7 +63,7 @@ let
} ;
description = mkOption {
type = passwdEntry types . str ;
type = types . passwdEntry types . str ;
default = " " ;
example = " A l i c e Q . U s e r " ;
description = ''
@ -134,7 +128,7 @@ let
} ;
home = mkOption {
type = passwdEntry types . path ;
type = types . passwdEntry types . path ;
default = " / v a r / e m p t y " ;
description = " T h e u s e r ' s h o m e d i r e c t o r y . " ;
} ;
@ -169,7 +163,7 @@ let
} ;
shell = mkOption {
type = types . nullOr ( types . either types . shellPackage ( passwdEntry types . path ) ) ;
type = types . nullOr ( types . either types . shellPackage ( types . passwdEntry types . path ) ) ;
default = pkgs . shadow ;
defaultText = literalExpression " p k g s . s h a d o w " ;
example = literalExpression " p k g s . b a s h I n t e r a c t i v e " ;
@ -349,7 +343,7 @@ let
options = {
name = mkOption {
type = passwdEntry types . str ;
type = types . passwdEntry types . str ;
description = ''
The name of the group . If undefined , the name of the attribute set
will be used .