(no title)
jbott | 2 years ago
1. https://grahamc.com/blog/erase-your-darlings/
2. https://gist.github.com/mx00s/ea2462a3fe6fdaa65692fe7ee824de...
3. https://gist.github.com/jbott/531b9d555dae7f197f25326ef251f1...
jbott | 2 years ago
1. https://grahamc.com/blog/erase-your-darlings/
2. https://gist.github.com/mx00s/ea2462a3fe6fdaa65692fe7ee824de...
3. https://gist.github.com/jbott/531b9d555dae7f197f25326ef251f1...
SkyMarshal|2 years ago
With / all in memory it automatically gets wiped and recreated every reboot, without needing to actively erase a disk, and thus with much less drive wear (depending on how frequently you reboot). It’s also faster on some things when loading from RAM instead of the disk. And it’s overall a cleaner, simpler setup.
https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/
You can also put tmpfs on home as well, using Impermanence and Home Manager to persist things like ~/.config and whatever other files or folders need to persist between reboots:
https://elis.nu/blog/2020/06/nixos-tmpfs-as-home/
tmpfs on / is enabled by NixOS’s unique design, in which it keeps the entire system in /nix/store and then softlinks all the paths into their appropriate place in /. With tmpfs on /, NixOS automatically recreates those softlinks in tmpfs on reboot. Very little setup effort is required to make this work.
Cu3PO42|2 years ago
jbott|2 years ago
Unless you’re working on a server with a ton of ram, I also think using tmpfs is more likely to shoot yourself in the foot with excess memory pressure. I don’t know of a way for the kernel to free memory if you write a huge file to the tmpfs partition by mistake, unless you use swap, and then you have the problems that come with that.
Tmpfs might be faster though!
laurencerowe|2 years ago
someplaceguy|2 years ago
Tainnor|2 years ago
solatic|2 years ago
yjftsjthsd-h|2 years ago
Tools and dependencies go in nix. Indexes and temporary build stuff is just cache, which you can still have (I'd lean towards regenerating per reboot, but YMMV).
> but it's going to be a lot of effort trying to figure out where all your tools are dumping their state.
Fair. Kind of an indictment of the current state of the ecosystem, but yes.
n42|2 years ago
you can also use impermanence with home-manager if you want
https://github.com/nix-community/impermanence#home-manager
Cloudef|2 years ago
> but it's going to be a lot of effort trying to figure out where all your tools are dumping their state.
This is true though, if you dont want to manage all of their configs from nix, I would make their dump locations, or $XDG_DIRS/$HOME (if you are lazy) permanent in this case.