How close can I get to having absolutely every file managed by Nixos?

I am pretty happy with my configs now, with home manager but no flakes so far. I am, however, annoyed by all the dotfiles that I didn't define, and I'm worried how many other files are laying around without getting imperatively defined.

I'm sort of picturing a kiosk mode, where every time I reboot everything is wiped and I only have what I defined. Any files I want to keep are on other partitions or network locations mapped in my config. If a new config file is created by changing a setting in an application, I want to be notified so I can add it to my Nix configs.

Is this possible? Is it a terrible idea?

The biggest challenge I see is in installing games, because it looks like they often leave bits all over the place.

16 points · 7 comments · view on lemmy.world

7 Comments

dinckelman@programming.dev · 12 pts · 283d (3 replies)
[ removed ]
clay_pidgin@sh.itjust.works · 3 pts · 283d (2 replies)

THAT'S the word I was looking for!

Thank you.

Now I can hit the wiki. https://nixos.wiki/wiki/Impermanence

greywolf0x1@lemmy.ml · 2 pts · 280d (1 reply)

Be careful, backup regularly.

clay_pidgin@sh.itjust.works · 1 pts · 280d

Thank you for the caution!

gsx@discuss.tchncs.de · 7 pts · 284d (3 replies)

I did more or less your idea with kiosk mode. Everything which is not explicitly defined by nix is on tmpfs in my setup. But I don't play games on this machine, so I can't say anything to this.

I've got the idea from "erase your darlings": https://grahamc.com/blog/erase-your-darlings/

The same thing with btrfs: https://hanckmann.com/posts/20230104-nixos-and-erasing-my-darlings/

The whole idea is about impermanence: https://github.com/nix-community/impermanence

clay_pidgin@sh.itjust.works · 2 pts · 283d (2 replies)

This is fabulous - exactly what I was hoping for!

I feel like I want a easy to either detect live, or diff before shutdown, changes and file creation that I might want to add to my impermanent configs.

responsible_sith@programming.dev · 4 pts · 282d (1 reply)

If you go with the btrfs option, you could change the wipe script to copy all files to a specific location and manually inspect that after reboot.

clay_pidgin@sh.itjust.works · 1 pts · 282d

That sounds clever. I like it.

Never used BTRFS but notes a good time to learn!