Compare commits

...

2 Commits

Author SHA1 Message Date
John Lancaster
bf6c231d1f added https 2025-02-17 01:13:14 -06:00
John Lancaster
f0dd952341 fleshed out restic stuff 2025-02-17 01:13:04 -06:00
2 changed files with 26 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
lokiHost = "loki.john-stream.com:3100"; lokiHost = "loki.john-stream.com";
in in
{ {
systemd.services.promtail.serviceConfig = { systemd.services.promtail.serviceConfig = {
@@ -22,7 +22,7 @@ in
positions = { positions = {
filename = "/tmp/positions.yaml"; filename = "/tmp/positions.yaml";
}; };
clients = [{url = "http://${lokiHost}/loki/api/v1/push";}]; clients = [{url = "https://${lokiHost}/loki/api/v1/push";}];
scrape_configs = [ scrape_configs = [
{ {
job_name = "journal"; job_name = "journal";

View File

@@ -2,19 +2,41 @@
{ {
sops.secrets."restic_password" = { }; sops.secrets."restic_password" = { };
environment.systemPackages = with pkgs; [
restic
(pkgs.writeShellScriptBin "restic-backup" "sudo systemctl start restic-backups-localBackup.service")
(pkgs.writeShellScriptBin "restic-backup-check" "sudo journalctl -b -u restic-backups-localBackup.service")
];
environment.variables = {
RESTIC_REPOSITORY = "/mnt/restic/appdaemon";
RESTIC_PASSWORD = "${builtins.readFile config.sops.secrets."restic_password".path}";
};
services.restic.backups = { services.restic.backups = {
localbackup = { localBackup = {
repository = "/mnt/restic/appdaemon"; repository = "/mnt/restic/appdaemon";
passwordFile = config.sops.secrets."restic_password".path; passwordFile = config.sops.secrets."restic_password".path;
initialize = true; initialize = true;
timerConfig = {
OnCalendar = "03:00";
RandomizedDelaySec = "2h";
Persistent = true;
};
paths = [ paths = [
"/home" "/home"
"/conf"
"/etc/nixos"
]; ];
exclude = [ exclude = [
".cache" ".cache"
".vscode-server" ".vscode*"
".devenv" ".devenv"
".venv" ".venv"
"build"
"dist"
"__pycache__"
"*.egg-info"
]; ];
}; };
}; };