nix-config/hosts/cirrostratus/restic.nix
Gabe Venberg c36c756862 lots of stuff:
Moved syncthing to system service
Restic actually works now
removed some old system configs.
formatting.
2024-09-30 16:06:17 +02:00

39 lines
867 B
Nix

{
inputs,
config,
pkgs,
lib,
...
}: let
port = "8090";
in {
services.restic.server = lib.mkIf (inputs ? nix-secrets) {
enable = true;
appendOnly = true;
dataDir = "/backup/restic";
extraFlags = [
# "--htpasswd-file ${config.sops.secrets.restic-server-credentials.path}"
# "--private-repos"
];
listenAddress = "127.0.0.1:${port}";
};
services.nginx.virtualHosts."restic.venberg.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:${port}";
};
};
sops = lib.mkIf (inputs ? nix-secrets) {
secrets.restic-server-credentials = {
sopsFile = "${inputs.nix-secrets}/restic-server";
format = "binary";
path = "/backup/restic/.htpasswd";
owner="restic";
};
};
environment.systemPackages = with pkgs; [
restic
];
}