restic: make global module

This commit is contained in:
wo2wz 2025-11-21 11:31:22 -05:00
parent 12a7ea01dc
commit bc2cb88ea4
2 changed files with 20 additions and 20 deletions

View file

@ -3,9 +3,6 @@
{ {
sops.secrets."restic/password" = {}; sops.secrets."restic/password" = {};
# for use as restic backend
# environment.systemPackages = [ pkgs.rclone ];
systemd.services = { systemd.services = {
db-backup = { db-backup = {
wantedBy = [ "restic-backups-main.service" ]; wantedBy = [ "restic-backups-main.service" ];
@ -44,23 +41,6 @@
restic-backups-main.serviceConfig.Type = "oneshot"; 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 = { services.restic.backups = {
main = { main = {
user = "restic"; user = "restic";

View 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";
};
}