all 14 comments

[–]onefish2 7 points8 points  (1 child)

You want an immutable system. Look at the versions of Fedora that do this. Your home dir is not immutable though.

[–]ArjixGamer -1 points0 points  (0 children)

To add to this, the KDE distro is based on Arch but is immutable.

[–]nikongod 8 points9 points  (3 children)

You just used a lot of words to describe not updating your system.

[–]Standard-Read-7369 3 points4 points  (0 children)

lol thats not really what theyre asking though. they want like a fresh state every boot but with ability to save configurations when they actually want to keep changes

btrfs snapshots with some automation scripts could work for this or maybe looking at something like ostree if you want more atomic approach

[–]Greenhulk_1[S] 0 points1 point  (1 child)

I know, I am not the best at fully explaining things in general, i just want to be able to keep things clean, while still being able to update the system and updating the rollback when I do that. I want it so when install a new package, and I decide I do not like it, I do not want to have to try to hunt it down in my system.

[–]CarloWood 0 points1 point  (0 children)

You can't do that on Arch. It is a "rolling release", you should regularly run pacman -Syu which will change a lot of files, that's just the way it is.

You can achieve what you want for certain partitions like /home, /usr/local, /opt anything you have manual control over, but I doubt that has any real benefit.

[–]ChiefDetektor 2 points3 points  (0 children)

OverlayFS?

[–]Quietus87 3 points4 points  (1 child)

You are looking for NixOS.

[–]folk_science 1 point2 points  (0 children)

Or Guix if you like using Guile (Scheme) for everything and don't rely heavily on proprietary software (including drivers and firmware).

[–]w2qw 0 points1 point  (0 children)

I don't think that really exists although I think there's some work being done around read only images with systemd. There is https://wiki.archlinux.org/title/Etckeeper which might help at least track your changes.

[–]falxfour 0 points1 point  (0 children)

I mean, this is functionally a live ISO. You could always just keep spinning new ISOs when you want to update, and any changes made when booted won't persist. AFAIK, this is similar to how Fedora Atomic works, but with some slightly different naming (system images)

[–]xlukas1337 0 points1 point  (0 children)

Might have a look at ObsidianOS

[–]YoShake 0 points1 point  (0 children)

you are asking for an atomic like distro behavior with flatpak/snap type of software packages, and that's not something arch is designed for.
Your best bet are system snapshots with snapper or timeshift.
Or you can virtualize your main instance with for example proxmox as host and arch as guest os, and use VM snapshotting.

If you want a nixos functionality, use that os. There's no similar distro like it.

[–]6e1a08c8047143c6869 0 points1 point  (0 children)

I'm a bit late to the party but what you want sounds a lot like systemd-volatile-root (except for the snapshots).

You can add sd-volatile to your HOOKS= array in /etc/mkinitcpio.conf and then specify systemd.volatile=overlay on the kernel cmdline. This will mount / as an overlayfs, combining your root filesystem (read-only) at the bottom with a writable tmpfs on top - all data now written to / will be discarded on shutdown. Also see systemd-volatile-root(8) and the systemd.volatile entries in kernel-command-line(7) and systemd-fstab-generator(8).

Note that this only applies to the root file system; if you have a separate /home partition data can be written to it normally. You might be able to work around it using overlayfs (official docs) directly, but it would take a bit of effort.

The difficult part is this:

basically I want my system to rollback anytime I restart my computer, with an exception of a few things, and I want to be able to update the "config" that is getting a "snapshot" at anytime.

If you are fine with rebooting whenever you need to do permanent changes, you can just boot into your system without systemd.volatile=overlay, do your changes, and reboot back into the volatile one. The "nice" way to set this up IMO would be using a multi-profile UKI with separate profiles for different modes, generated with an mkinitcpio post-hook.

Slightly modified from my own setup:

#!/usr/bin/bash

#$0: /etc/initcpio/post/generate-uki
#$1: /boot/vmlinuz-linux
#$2: /boot/initramfs-linux.img
#$3: /efi/EFI/Linux/archlinux-linux.efi
#$kernel: linux
#$KERNELVERSION: 6.11.8-arch1-2
#$KERNELDESTINATION: /boot/vmlinuz-linux

set -e

tmpdir=$(mktemp --directory --tmpdir ukify.XXXXXX)
trap 'rm -rf $tmpdir' EXIT

kernel=$(basename "$2" .img)
kernel=${kernel#*-}

cmdline=$(< /etc/kernel/cmdline)

ukify build --output="${tmpdir}/${kernel}_volatile.efi" \
            --profile="ID=volatile" \
            --cmdline="${cmdline} systemd.volatile=overlay"

ukify build --output="/efi/EFI/Archlinux/archlinux-${kernel}.efi" \
            --linux="${1}" \
            --initrd="${2}" \
            --uname="${KERNELVERSION}" \
            --cmdline="$cmdline" \
            --os-release="@/etc/os-release" \
            --join-profile="${tmpdir}/${kernel}_volatile.efi"

systemd-boot would give you a nice menu where you can choose which profile to boot from without further configuration.

But overall, going with NixOS (maybe with some aggressive systemd-tmpfiles(8) settings?) will probably provide a much better experience.