diff --git a/hosts/dnsc-server/default.nix b/hosts/dnsc-server/default.nix index c41a194..c8a7706 100644 --- a/hosts/dnsc-server/default.nix +++ b/hosts/dnsc-server/default.nix @@ -18,6 +18,7 @@ ../../modules/actual-server ../../modules/immich ../../modules/cockpit + ../../modules/backrest ]; # General diff --git a/modules/backrest/default.nix b/modules/backrest/default.nix new file mode 100644 index 0000000..7f3f580 --- /dev/null +++ b/modules/backrest/default.nix @@ -0,0 +1,33 @@ +{ + pkgs, + config, + lib, + ... +}: +{ + environment.systemPackages = lib.mkAfter ( + with pkgs; + [ + backrest + ] + ); + + systemd.user.services.backrest = { + Unit = { + Description = "Restic GUI"; + }; + + Service = { + Environment = [ + "BACKREST_PORT=127.0.0.1:9004" + "BACKREST_RESTIC_COMMAND=${pkgs.restic}/bin/restic" + "BACKREST_CONFIG=${config.home.homeDirectory}/.backrest/config" + "BACKREST_DATA=${config.home.homeDirectory}/.backrest/data" + ]; + ExecStart = "${pkgs.backrest}/bin/backrest"; + Restart = "on-failure"; + RestartSec = "5s"; + wantedBy = [ "multi-user.target" ]; + }; + }; +}