mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-22 01:11:02 +03:00
nixos/vdirsyncer: only use ProtectHome=yes with DynamicUser=yes
If a user is given it seems likely that their home directory is accessed.
This commit is contained in:
parent
cd06d2dd2a
commit
bc72dc08f2
2 changed files with 1 additions and 8 deletions
|
@ -45,6 +45,7 @@ let
|
||||||
}
|
}
|
||||||
// (optionalAttrs (cfg'.user == null) {
|
// (optionalAttrs (cfg'.user == null) {
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
|
ProtectHome = true;
|
||||||
})
|
})
|
||||||
// (optionalAttrs (cfg'.additionalGroups != [ ]) {
|
// (optionalAttrs (cfg'.additionalGroups != [ ]) {
|
||||||
SupplementaryGroups = cfg'.additionalGroups;
|
SupplementaryGroups = cfg'.additionalGroups;
|
||||||
|
@ -63,7 +64,6 @@ let
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
NoNewPrivileges = true;
|
NoNewPrivileges = true;
|
||||||
ProtectSystem = "strict";
|
ProtectSystem = "strict";
|
||||||
ProtectHome = true;
|
|
||||||
ProtectKernelTunables = true;
|
ProtectKernelTunables = true;
|
||||||
ProtectKernelModules = true;
|
ProtectKernelModules = true;
|
||||||
ProtectControlGroups = true;
|
ProtectControlGroups = true;
|
||||||
|
|
|
@ -217,13 +217,6 @@ import ./make-test-python.nix (
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# ProtectHome is the default, but we must access our storage
|
|
||||||
# in ~.
|
|
||||||
systemd.services = {
|
|
||||||
"vdirsyncer@alice".serviceConfig.ProtectHome = lib.mkForce false;
|
|
||||||
"vdirsyncer@bob".serviceConfig.ProtectHome = lib.mkForce false;
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users = {
|
users.users = {
|
||||||
alice.isNormalUser = true;
|
alice.isNormalUser = true;
|
||||||
bob.isNormalUser = true;
|
bob.isNormalUser = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue