use my branch for btrbk

This commit is contained in:
cy 2024-12-30 14:49:57 -05:00
parent 58de58ffa9
commit 1ffcc8d020
3 changed files with 16 additions and 14 deletions

16
flake.lock generated
View file

@ -73,19 +73,19 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-master": { "nixpkgs-btrbk": {
"locked": { "locked": {
"lastModified": 1735418999, "lastModified": 1735587871,
"narHash": "sha256-nFnQAzDqYhPsAdrcFRZMSnH0Tuj0gjKhSAJAep08Szc=", "narHash": "sha256-BXVJ4yIrBPJgReaQi3IdFvRhVg4wGPYGUBR/Id0hvWo=",
"owner": "nixos", "owner": "cything",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "42b2d9e78979c3df637916721e6373d99016503d", "rev": "9fd33c2070cfc3df4296eed81e041a3e313cea5f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "cything",
"ref": "btrbk",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "42b2d9e78979c3df637916721e6373d99016503d",
"type": "github" "type": "github"
} }
}, },
@ -111,7 +111,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-borg": "nixpkgs-borg", "nixpkgs-borg": "nixpkgs-borg",
"nixpkgs-master": "nixpkgs-master", "nixpkgs-btrbk": "nixpkgs-btrbk",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"treefmt": "treefmt" "treefmt": "treefmt"
} }

View file

@ -18,7 +18,7 @@
}; };
nixpkgs-borg.url = "github:cything/nixpkgs/borg"; nixpkgs-borg.url = "github:cything/nixpkgs/borg";
nixpkgs-master.url = "github:nixos/nixpkgs/42b2d9e78979c3df637916721e6373d99016503d"; nixpkgs-btrbk.url = "github:cything/nixpkgs/btrbk";
}; };
outputs = outputs =

View file

@ -1,7 +1,6 @@
{ {
config, config,
pkgs, pkgs,
lib,
inputs, inputs,
... ...
}: }:
@ -10,9 +9,13 @@
./hardware-configuration.nix ./hardware-configuration.nix
../common.nix ../common.nix
{ {
disabledModules = [ "services/backup/borgbackup.nix" ]; disabledModules = [
"services/backup/borgbackup.nix"
"services/backup/btrbk.nix"
];
} }
(inputs.nixpkgs-borg + "/nixos/modules/services/backup/borgbackup.nix") (inputs.nixpkgs-borg + "/nixos/modules/services/backup/borgbackup.nix")
(inputs.nixpkgs-btrbk + "/nixos/modules/services/backup/btrbk.nix")
]; ];
sops.age.keyFile = "/root/.config/sops/age/keys.txt"; sops.age.keyFile = "/root/.config/sops/age/keys.txt";
@ -251,7 +254,9 @@
services.btrbk.instances.local = { services.btrbk.instances.local = {
onCalendar = "hourly"; onCalendar = "hourly";
snapshotOnly = true;
settings = { settings = {
# only create snapshots automatically. backups are triggered manually with `btrbk resume`
snapshot_preserve = "7d"; snapshot_preserve = "7d";
snapshot_preserve_min = "2d"; snapshot_preserve_min = "2d";
target_preserve = "*d"; target_preserve = "*d";
@ -265,9 +270,6 @@
}; };
}; };
}; };
# only create snapshots automatically. backups are triggered manually
systemd.services."btrbk-local".serviceConfig.ExecStart =
lib.mkForce "${pkgs.btrbk}/bin/btrbk -c /etc/btrbk/local.conf snapshot";
programs.steam = { programs.steam = {
enable = true; enable = true;