Get SnapOS!

SnapOS Handbook

Installing
About the installationThe minimal USBConfiguring the networkPreparing the disksFormatting and mountingThe hardware fileWriting flake.nixWriting configuration.nixThe boot loaderUsers and languageChoosing a desktopProgramsAdding the SnapOS packsInstallingFinishing
The SnapOS packs
Every packPack optionsThe full SnapOS
Working with your system
Changing the systemProgramsUpdatesUndoingSnapGuard and .deb filesIs the Debian layer isolated?When something breaks

Handbook: Working with your system

Every change is a line in a file in /etc/snapos, and every change can be undone. Each task shows the command and, if you added the commands pack, the shorter snapos one.

Changing the system

Edit a file, then apply it:

TaskCommandWith the commands pack
edit the systemsudo nano /etc/snapos/configuration.nixsnapos config
see what would changesnapos-rebuild buildsnapos diff
apply nowsudo snapos-rebuild switchsnapos rebuild
apply at the next startsudo snapos-rebuild bootsnapos rebuild --next-boot

Programs

TaskCommandWith the commands pack
searchnix search nixpkgs vlcsnapos find vlc
installadd vlc to the list, rebuildsnapos add vlc
removeremove it from the list, rebuildsnapos remove vlc
use once, without installingnix shell nixpkgs#vlcsnapos shell vlc

snapos find and add

Updates

Everything comes from the inputs in flake.lock. To move them all forward and build the result for the next start:

cd /etc/snapos
sudo nix flake update
sudo snapos-rebuild boot

With the updater pack, SnapOS tells you at login when there is a new SnapOS release and snapos update moves only the snapos input, with the guard that undoes a failed start.

Undoing

Each rebuild keeps the previous system as a generation, listed in the boot menu.

TaskCommandWith the commands pack
list themsnapos-rebuild list-generationssnapos generations
go backsudo snapos-rebuild switch --rollbacksnapos rollback
free spacesudo nix-collect-garbage --delete-older-than 14dsnapos gc

SnapGuard and .deb files

snapguard scan ~/Downloads   # scan a folder
snapguard status             # engine and real-time protection
snap-deb program.deb         # scanned, then installed in the Debian layer

Is the Debian layer isolated?

No, on purpose. The Debian layer is a real Debian living next to your system, not a sandbox: a program in it reads and writes your files, uses the screen, sound and devices, and talks to other programs like any native program. That is what lets .deb programs such as Steam work without workarounds.

What this means:

When something breaks

sudo snapos-rebuild switch --show-trace   # the full error
snapos doctor    # graphics, boot, network and antivirus (commands pack)
snapos log       # the output of the last rebuild

If the system does not start, pick an older generation in the boot menu, then fix the file and rebuild.