diff --git a/nixos/systems/omen/impermenance.nix b/nixos/systems/omen/impermenance.nix index 0d08566..5dcd80d 100644 --- a/nixos/systems/omen/impermenance.nix +++ b/nixos/systems/omen/impermenance.nix @@ -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" = {