fix home-assistant backup configuration
This commit is contained in:
parent
bc627afade
commit
360d3a1159
1 changed files with 11 additions and 8 deletions
|
@ -183,18 +183,21 @@ in
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
users.groups = {
|
# Adds the "backup" user to the "hass" group.
|
||||||
hass = {
|
users.groups.hass = {
|
||||||
members = [ "backup" ];
|
members = [ "backup" ];
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# This allows the "backup" user, member of the "backup" group, to access what's inside the home
|
||||||
|
# folder, which is needed for accessing the "backups" folder. It allows to read (r), enter the
|
||||||
|
# directory (x) but not modify what's inside.
|
||||||
|
users.users.hass.homeMode = "0750";
|
||||||
|
|
||||||
systemd.services.home-assistant.serviceConfig = {
|
systemd.services.home-assistant.serviceConfig = {
|
||||||
# Setup permissions needed for backups, as the backup user is member of the hass group.
|
# This allows all members of the "hass" group to read files, list directories and enter
|
||||||
|
# directories created by the home-assistant service. This is needed for the "backup" user,
|
||||||
|
# member of the "hass" group, to backup what is inside the "backup/" folder.
|
||||||
UMask = lib.mkForce "0027";
|
UMask = lib.mkForce "0027";
|
||||||
StateDirectory = "hass";
|
|
||||||
StateDirectoryMode = lib.mkForce "0750";
|
|
||||||
SupplementaryGroups = [ config.users.groups.keys.name ];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue