diff options
author | Nadrieril <nadrieril@gmail.com> | 2017-07-21 20:15:27 +0100 |
---|---|---|
committer | Nadrieril <nadrieril@gmail.com> | 2017-08-06 22:57:53 +0100 |
commit | a4d07290cba3208a2ff930c8cfb594ff809ec7ad (patch) | |
tree | 332833fb527ab59ea9b7edf9f2f1e63191257c10 /nixos/modules/services/network-filesystems/rsyncd.nix | |
parent | 94fc613cc7b2be6fb92ddfd5f2c1649b27459be0 (diff) | |
download | nixpkgs-a4d07290cba3208a2ff930c8cfb594ff809ec7ad.tar nixpkgs-a4d07290cba3208a2ff930c8cfb594ff809ec7ad.tar.gz nixpkgs-a4d07290cba3208a2ff930c8cfb594ff809ec7ad.tar.bz2 nixpkgs-a4d07290cba3208a2ff930c8cfb594ff809ec7ad.tar.lz nixpkgs-a4d07290cba3208a2ff930c8cfb594ff809ec7ad.tar.xz nixpkgs-a4d07290cba3208a2ff930c8cfb594ff809ec7ad.tar.zst nixpkgs-a4d07290cba3208a2ff930c8cfb594ff809ec7ad.zip |
rsync service: allow running as not root
Diffstat (limited to 'nixos/modules/services/network-filesystems/rsyncd.nix')
-rw-r--r-- | nixos/modules/services/network-filesystems/rsyncd.nix | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/nixos/modules/services/network-filesystems/rsyncd.nix b/nixos/modules/services/network-filesystems/rsyncd.nix index 0759fcc2a3b..054057d52ab 100644 --- a/nixos/modules/services/network-filesystems/rsyncd.nix +++ b/nixos/modules/services/network-filesystems/rsyncd.nix @@ -83,6 +83,24 @@ in }; }; + user = mkOption { + type = types.str; + default = "root"; + description = '' + The user to run the daemon as. + By default the daemon runs as root. + ''; + }; + + group = mkOption { + type = types.str; + default = "root"; + description = '' + The group to run the daemon as. + By default the daemon runs as root. + ''; + }; + }; }; @@ -96,8 +114,11 @@ in description = "Rsync daemon"; wantedBy = [ "multi-user.target" ]; restartTriggers = [ config.environment.etc."rsyncd.conf".source ]; - serviceConfig.ExecStart = "${pkgs.rsync}/bin/rsync --daemon --no-detach"; + serviceConfig = { + ExecStart = "${pkgs.rsync}/bin/rsync --daemon --no-detach"; + User = cfg.user; + Group = cfg.group; + }; }; - }; } |