nixos/restic-rest-server: Autocreate empty .htpasswd if needed for service boot
When `privateRepos = true`, the service will not start if the `.htpasswd` does not exist. Use `systemd-tmpfiles` to autocreate an (empty) file to ensure the service can boot before actual `htpasswd` contents are registered. This is safe as restic-rest-server will deny all entry if the file is empty.
This commit is contained in:
parent
4bc4c7f1a0
commit
8729e8e261
1 changed files with 4 additions and 0 deletions
|
@ -95,6 +95,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = mkIf cfg.privateRepos [
|
||||
"f ${cfg.dataDir}/.htpasswd 0700 restic restic -"
|
||||
];
|
||||
|
||||
users.users.restic = {
|
||||
group = "restic";
|
||||
home = cfg.dataDir;
|
||||
|
|
Loading…
Reference in a new issue