restic: make global module
This commit is contained in:
parent
12a7ea01dc
commit
bc2cb88ea4
2 changed files with 20 additions and 20 deletions
|
|
@ -3,9 +3,6 @@
|
|||
{
|
||||
sops.secrets."restic/password" = {};
|
||||
|
||||
# for use as restic backend
|
||||
# environment.systemPackages = [ pkgs.rclone ];
|
||||
|
||||
systemd.services = {
|
||||
db-backup = {
|
||||
wantedBy = [ "restic-backups-main.service" ];
|
||||
|
|
@ -44,23 +41,6 @@
|
|||
restic-backups-main.serviceConfig.Type = "oneshot";
|
||||
};
|
||||
|
||||
# make wrapper to run restic rootless
|
||||
users = {
|
||||
users.restic = {
|
||||
group = "restic";
|
||||
isSystemUser = true;
|
||||
};
|
||||
groups.restic = {};
|
||||
};
|
||||
|
||||
security.wrappers.restic = {
|
||||
source = lib.getExe pkgs.restic;
|
||||
owner = "restic";
|
||||
group = "restic";
|
||||
permissions = "500";
|
||||
capabilities = "cap_dac_read_search+ep";
|
||||
};
|
||||
|
||||
services.restic.backups = {
|
||||
main = {
|
||||
user = "restic";
|
||||
|
|
|
|||
20
modules/nixos/services/restic.nix
Normal file
20
modules/nixos/services/restic.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# make wrapper to run restic rootless
|
||||
users = {
|
||||
users.restic = {
|
||||
group = "restic";
|
||||
isSystemUser = true;
|
||||
};
|
||||
groups.restic = {};
|
||||
};
|
||||
|
||||
security.wrappers.restic = {
|
||||
source = lib.getExe pkgs.restic;
|
||||
owner = "restic";
|
||||
group = "restic";
|
||||
permissions = "500";
|
||||
capabilities = "cap_dac_read_search+ep";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue