From fabcc2cf7b98608424da4d2031f826af88b547a2 Mon Sep 17 00:00:00 2001 From: Luke Clifton Date: Sun, 28 Dec 2014 13:17:37 +0800 Subject: Added btsync group to btsync user --- nixos/modules/services/networking/btsync.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos') diff --git a/nixos/modules/services/networking/btsync.nix b/nixos/modules/services/networking/btsync.nix index 7ddc9e1045e41..f1bf5a5e3f9cf 100644 --- a/nixos/modules/services/networking/btsync.nix +++ b/nixos/modules/services/networking/btsync.nix @@ -246,6 +246,7 @@ in home = "/var/lib/btsync"; createHome = true; uid = config.ids.uids.btsync; + group = "btsync"; }; systemd.services.btsync = with pkgs; { -- cgit 1.4.1 From 5866a9df035f8cbfe05379e771793ff493517389 Mon Sep 17 00:00:00 2001 From: Luke Clifton Date: Sun, 28 Dec 2014 13:23:10 +0800 Subject: added group --- nixos/modules/services/networking/btsync.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos') diff --git a/nixos/modules/services/networking/btsync.nix b/nixos/modules/services/networking/btsync.nix index f1bf5a5e3f9cf..da8564774e6a4 100644 --- a/nixos/modules/services/networking/btsync.nix +++ b/nixos/modules/services/networking/btsync.nix @@ -249,6 +249,10 @@ in group = "btsync"; }; + users.extraGroups = [ + { name = "btsync"; + }]; + systemd.services.btsync = with pkgs; { description = "Bittorrent Sync Service"; wantedBy = [ "multi-user.target" ]; -- cgit 1.4.1 From 5fdd6f6a66b8b474bee09d2ee5e2a27565199ef8 Mon Sep 17 00:00:00 2001 From: Luke Clifton Date: Sun, 28 Dec 2014 16:39:56 +0800 Subject: Change umask --- nixos/modules/services/networking/btsync.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos') diff --git a/nixos/modules/services/networking/btsync.nix b/nixos/modules/services/networking/btsync.nix index da8564774e6a4..ddceaa13d7ba5 100644 --- a/nixos/modules/services/networking/btsync.nix +++ b/nixos/modules/services/networking/btsync.nix @@ -257,6 +257,7 @@ in description = "Bittorrent Sync Service"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; + UMask = "0002"; serviceConfig = { Restart = "on-abort"; User = "btsync"; -- cgit 1.4.1 From 61ff1b2b0a9d59b9e851d65086e4fcb84d5d132c Mon Sep 17 00:00:00 2001 From: Luke Clifton Date: Sun, 28 Dec 2014 16:44:27 +0800 Subject: Moved UMask to correct location --- nixos/modules/services/networking/btsync.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/btsync.nix b/nixos/modules/services/networking/btsync.nix index ddceaa13d7ba5..0bb22ebe4b967 100644 --- a/nixos/modules/services/networking/btsync.nix +++ b/nixos/modules/services/networking/btsync.nix @@ -257,9 +257,9 @@ in description = "Bittorrent Sync Service"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - UMask = "0002"; serviceConfig = { Restart = "on-abort"; + UMask = "0002"; User = "btsync"; ExecStart = "${bittorrentSync}/bin/btsync --nodaemon --config ${configFile}"; -- cgit 1.4.1 From 0c477eb38fe0736a6853a2e8148b1e94c163cd97 Mon Sep 17 00:00:00 2001 From: Luke Clifton Date: Sun, 28 Dec 2014 17:26:59 +0800 Subject: Documentation update --- nixos/modules/services/networking/btsync.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/services/networking/btsync.nix b/nixos/modules/services/networking/btsync.nix index 0bb22ebe4b967..34bddf9087311 100644 --- a/nixos/modules/services/networking/btsync.nix +++ b/nixos/modules/services/networking/btsync.nix @@ -88,7 +88,7 @@ in use systemctl start btsync@user to start the daemon only for user user, using the configuration file located at - $HOME/.config/btsync.conf + $HOME/.config/btsync.conf. ''; }; @@ -223,6 +223,21 @@ in --generate-secret. Note that this secret will be put inside the Nix store, so it is realistically not very secret. + + If you would like to be able to modify the contents of this + directories, it is recommended that you make your user a + member of the btsync group. + + Directories in this list should be in the + btsync group, and that group must have + write access to the directory. It is also recommended that + chmod g+s is applied to the directory + so that any sub directories created will also belong to + the btsync group. Also, + setfacl -d -m group:btsync:rwx and + setfacl -m group:btsync:rwx should also + be applied so that the sub directories are writable by + the group. ''; }; }; -- cgit 1.4.1 From b625c3dd4b37fcffb51fe59df811c3d59fd76c2b Mon Sep 17 00:00:00 2001 From: Luke Clifton Date: Sun, 28 Dec 2014 18:10:02 +0800 Subject: Added group id to ids.nix --- nixos/modules/misc/ids.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos') diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 3bb7fdb9b2d6e..df82bc8b8901f 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -310,6 +310,7 @@ kubernetes = 158; fleet = 159; gitlab = 160; + btsync = 161; # When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399! -- cgit 1.4.1 From 3c8914f94ead5245b2495a0229730fa7e3f17308 Mon Sep 17 00:00:00 2001 From: Luke Clifton Date: Sun, 28 Dec 2014 19:47:12 +0800 Subject: Changed group id to match user id --- nixos/modules/misc/ids.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos') diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index df82bc8b8901f..4471ed46de509 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -272,6 +272,7 @@ jenkins = 109; systemd-journal-gateway = 110; notbit = 111; + btsync = 113; monetdb = 115; foundationdb = 118; newrelic = 119; @@ -310,7 +311,6 @@ kubernetes = 158; fleet = 159; gitlab = 160; - btsync = 161; # When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399! -- cgit 1.4.1