Skip to content

Commit

Permalink
Start auto zfs snapshots for manganese
Browse files Browse the repository at this point in the history
  • Loading branch information
giodamelio committed Jan 7, 2025
1 parent d68e0ca commit 8fb3565
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions src/nixosModules/machines/manganese/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,28 @@
root.nixosModules.users.server

# Autosnapshot ZFS and send to NAS
# root.nixosModules.core.zfs-backup
# (_: {
# gio.services.zfs_backup = {
# enable = true;
# syncToGallium = true;
# datasets = [
# "tank/home"
# "tank/nix"
# "tank/root"
# ];
# };
# })
(_: {
# Automatically create ZFS snapshots
services.sanoid = {
enable = true;

datasets = let
defaultSnapshotSettings = {
hourly = 48;
daily = 32;
monthly = 8;
yearly = 8;

autosnap = true;
autoprune = true;
};
in {
"tank/root" = defaultSnapshotSettings;
"tank/nix" = defaultSnapshotSettings;
"tank/home" = defaultSnapshotSettings;
};
};
})

({pkgs, ...}: {
networking.hostId = "cf399625";
Expand Down

0 comments on commit 8fb3565

Please sign in to comment.