Fix usage of rolling_datasets on omen

Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
magic_rb 2023-11-03 20:11:43 +01:00
parent 99005cd768
commit fd97d611f6
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -1,4 +1,12 @@
{ inputs', pkgs, ... }:
let
rollbackStart =
pkgs.writeText "rollback-start" ''
${pkgs.rolling_datasets}/bin/roll_dataset "omen-ssd/ephemeral/home" "10"
${pkgs.rolling_datasets}/bin/roll_dataset "omen-ssd/ephemeral/root" "10"
${pkgs.rolling_datasets}/bin/roll_dataset "omen-ssd/ephemeral/nix-tmp" "10"
'';
in
{
nixpkgs.overlays = [
inputs'.self.overlays.show-files-to-be-deleted
@ -56,6 +64,7 @@
];
files = [
{ file = ".config/wallpaper"; method = "symlink"; }
{ file = ".gitignore"; method = "symlink"; }
];
};
};
@ -63,6 +72,8 @@
boot.initrd.systemd.storePaths = with pkgs; [
zfs
busybox
rolling_datasets
rollbackStart
];
boot.initrd.systemd.services.rollback = {
description = "Rollback ZFS datasets to a pristine state";
@ -81,11 +92,7 @@
];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
${pkgs.rolling_datasets}/bin/roll_dataset "omen-ssd/ephemeral/home" "10"
${pkgs.rolling_datasets}/bin/roll_dataset "omen-ssd/ephemeral/root" "10"
${pkgs.rolling_datasets}/bin/roll_dataset "omen-ssd/ephemeral/nix-tmp" "10"
'';
serviceConfig.ExecStart = "/bin/sh ${rollbackStart}";
};
systemd.services."mount-old-homes" = {