post_install () {
    if [ ! -d /home/.snapshots ]; then
        mkdir /home/.snapshots
        btrfs subvolume create /var/btrfs/@home-snapshots
        mount -t btrfs -o subvol=@home-snapshots /dev/mapper/root /home/.snapshots
        genfstab -U -f /home/.snapshots / >> /etc/fstab
    fi
    if [ ! -d /.snapshots ]; then
        mkdir /.snapshots
        btrfs subvolume create /var/btrfs/@root-snapshots
        mount -t btrfs -o subvol=@home-snapshots /dev/mapper/root /.snapshots
        genfstab -U -f /.snapshots / >> /etc/fstab
    fi
    systemctl enable --now snapper-backup
    systemctl enable --now snapper-cleanup.timer
}

pre_remove(){
    systemctl disable snapper-cleanup.timer
}
