Add snapper for btrfs snapshot management

This commit is contained in:
iFargle 2023-12-12 14:23:58 +09:00
parent 8dd038ecf1
commit ed91ce1216
5 changed files with 16 additions and 2 deletions

View file

@ -39,6 +39,7 @@ nix develop -c /etc/nixos/git/docs/setup.sh
* Container running piaware software
# To Do List
* [x] Set up Snapper - [Link](https://search.nixos.org/options?channel=23.11&size=50&sort=relevance&type=packages&query=snapper)
* [ ] Try Attic - A self-hosted Nix Binary Cache server - [Link](https://discourse.nixos.org/t/introducing-attic-a-self-hostable-nix-binary-cache-server/24343)
* [ ] Try [compose2nix](https://github.com/aksiksi/compose2nix) - Docker Compose to Nix converter
* [ ] Make a dashboard for all Nixified devices (online status)

View file

@ -0,0 +1,9 @@
{ pkgs, desktop, ... }: {
environment.systemPackages = [ ] ++ lib.optional (builtins.isString desktop) pkgs.snapper-gui;
services.snapper = {
snapshotRootOnBoot = true;
cleanupInterval = "1d";
snapshotInterval = "1h";
};
}

View file

@ -1,4 +1,6 @@
{
imports = [ ../../common/services/snapper.nix ];
services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly";

View file

@ -1,6 +1,6 @@
{
boot.loader.grub.device = "/dev/nvme0n1";
boot.initrd.luks.devices."ROOT".device = "/dev/nvme0n1p2";
imports = [ ../../common/services/snapper.nix ];
services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly";

View file

@ -1,4 +1,6 @@
{
imports = [ ../../common/services/snapper.nix ];
services.btrfs.autoScrub.enable = true;
services.btrfs.autoScrub.interval = "weekly";