mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
Automate restic restore command creation
This commit is contained in:
parent
731f0ec615
commit
e6989963c7
6 changed files with 70 additions and 95 deletions
|
|
@ -1,9 +1,4 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.custom.services.syncthing;
|
||||
|
||||
|
|
@ -25,18 +20,5 @@ in
|
|||
dependentService = "syncthing.service";
|
||||
extraConfig.paths = [ config.services.syncthing.dataDir ];
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "syncthing-restore";
|
||||
text = ''
|
||||
sudo --user=${user} bash -c "
|
||||
systemctl stop syncthing.service
|
||||
restic-syncthing restore latest --target /
|
||||
systemctl start syncthing.service
|
||||
"
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue