git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/syncthing: do not use nogroup
8317663Peter Hoeg
nixos/modules/services/networking/syncthing.nix+4−10
@@ -291,7 +291,7 @@ in {
291
291
292 group = mkOption {
292 group = mkOption {
293 type = types.str;
293 type = types.str;
294− default = "nogroup";
294+ default = defaultUser;
295 description = ''
295 description = ''
296 Syncthing will be run under this group (group will not be created if it doesn't exist.
296 Syncthing will be run under this group (group will not be created if it doesn't exist.
297 This can be your user name).
297 This can be your user name).
@@ -403,18 +403,12 @@ in {
403 Group = cfg.group;
403 Group = cfg.group;
404 ExecStartPre = mkIf (cfg.declarative.cert != null || cfg.declarative.key != null)
404 ExecStartPre = mkIf (cfg.declarative.cert != null || cfg.declarative.key != null)
405 "+${pkgs.writers.writeBash "syncthing-copy-keys" ''
405 "+${pkgs.writers.writeBash "syncthing-copy-keys" ''
406− mkdir -p ${cfg.configDir}
407− chown ${cfg.user}:${cfg.group} ${cfg.configDir}
406+ install -dm700 -o ${cfg.user} -g ${cfg.group} ${cfg.configDir}
408− chmod 700 ${cfg.configDir}
409 ${optionalString (cfg.declarative.cert != null) ''
407 ${optionalString (cfg.declarative.cert != null) ''
410− cp ${toString cfg.declarative.cert} ${cfg.configDir}/cert.pem
408+ install -Dm400 -o ${cfg.user} -g ${cfg.group} ${toString cfg.declarative.cert} ${cfg.configDir}/cert.pem
411− chown ${cfg.user}:${cfg.group} ${cfg.configDir}/cert.pem
412− chmod 400 ${cfg.configDir}/cert.pem
413 ''}
409 ''}
414 ${optionalString (cfg.declarative.key != null) ''
410 ${optionalString (cfg.declarative.key != null) ''
415− cp ${toString cfg.declarative.key} ${cfg.configDir}/key.pem
411+ install -Dm400 -o ${cfg.user} -g ${cfg.group} ${toString cfg.declarative.key} ${cfg.configDir}/key.pem
416− chown ${cfg.user}:${cfg.group} ${cfg.configDir}/key.pem
417− chmod 400 ${cfg.configDir}/key.pem
418 ''}
412 ''}
419 ''}"
413 ''}"
420 ;
414 ;