@@ -6,7 +6,7 @@ moduleConfig: {
66} : {
77 options . services . vscode-server = let
88 inherit ( lib ) mkEnableOption mkOption ;
9- inherit ( lib . types ) lines listOf nullOr package str bool ;
9+ inherit ( lib . types ) lines listOf nullOr package str bool passwdEntry ;
1010 in {
1111 enable = mkEnableOption "VS Code Server autofix" ;
1212
@@ -50,17 +50,31 @@ moduleConfig: {
5050 '' ;
5151 } ;
5252
53- enableForAllUsers = mkOption {
54- type = bool ;
55- default = false ;
56- example = true ;
57- description = ''
58- Whether to enable the VS Code Server auto-fix service for all users.
53+ enableForUsers = {
54+ enable = mkOption {
55+ type = bool ;
56+ default = false ;
57+ example = true ;
58+ description = ''
59+ Whether to enable the VS Code Server auto-fix service for each user.
5960
60- This only makes sense if auto-fix-vscode-server is installed as a NixOS module.
61+ This only makes sense if auto-fix-vscode-server is installed as a NixOS module.
6162
62- This automatically sets up the service's symlinks for systemd in each users' home directory.
63- '' ;
63+ This automatically sets up the service's symlinks for systemd in each users' home directory.
64+ '' ;
65+ } ;
66+
67+ users = mkOption {
68+ type = listOf ( passwdEntry str ) ;
69+ default = builtins . attrNames ( lib . attrsets . filterAttrs ( username : userOptions : userOptions . isNormalUser ) config . users . users ) ;
70+ defaultText = "builtins.attrNames (lib.filterAttrs (_: userOptions: userOptions.isNormalUser) config.users.users)" ;
71+ example = [ "alice" "bob" ] ;
72+ description = ''
73+ List of users to enable the VS Code Server auto-fix service for.
74+
75+ By default this will fallback to the list of "normal" users.
76+ '' ;
77+ } ;
6478 } ;
6579 } ;
6680
@@ -69,7 +83,7 @@ moduleConfig: {
6983 cfg = config . services . vscode-server ;
7084 auto-fix-vscode-server =
7185 pkgs . callPackage ../../pkgs/auto-fix-vscode-server.nix
72- ( removeAttrs cfg [ "enable" "enableForAllUsers " ] ) ;
86+ ( removeAttrs cfg [ "enable" "enableForUsers " ] ) ;
7387 in
7488 mkIf cfg . enable ( mkMerge [
7589 {
0 commit comments