This setup masterfully treats the operating system as a disposable function, turning the "erase your darlings" philosophy into a practical reality. It is the ultimate expression of NixOS purity for those who demand a system that never accumulates digital rot.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Explode Root On Every Boot | Simplest Impermanent NixOS Setup 2026 feat. diskoAdded:
Keeping your operating system clean can be a challenge. For years, people have invented various cleaning tools or mental strategies just to delay the moment when eventually you have to reinstall your system or spend hours cherry-picking garbage to delete. But what if there was another way? What if instead of deleting the files we don't need, we could simply choose the files we do want to keep, dropping everything else on reboot? This is the core idea of an impermanent setup. a system that only keeps what you really want to keep, annihilating all and any junk accumulation. But how is that even possible? Believe it or not, but it's all thanks to one rarely mentioned property of Nixos, the ability to boot with nothing but/boot and/nix directories present. You can delete everything but these two directories from any Nexus system and Nexus will just regenerate itself the next time you reboot as if nothing ever happened.
Meaning if we wanted to, we could mount an ephemeral temps file system on route.
Basically putting all the files on RAM, then mount/nix and/boot directories from other partitions stored on your actual disc and get an evergreen next setup that cleans itself on every reboot. But that only completes half of our puzzle because then we also want to preserve specific files and directories between reboots. To do that, we can make a third persistent directory on our disk to store the files in directories we choose and then simply mount them into correct places. This can easily be achieved with a popular Nexus module called impermanence. But today we will use a more modern alternative called preservation. And finally, to make the installation process simple and reproducible, we will use a project called Nyx disco, allowing us to format our disc declaratively and install Nixo with one single command. So, open the vimjer.com website if you want to follow along. I will leave all the code snippets, commands, and some useful links there. Consider becoming a supporter and coffee while you're at it.
Supporters get access to new videos early and in general make these videos possible. And now, without further ado, let's get right into it. Starting from the graphical installer, we're not going to use the installer itself, so you can close it right away and instead open the terminal. Then, create a new directory anywhere you want. And inside run this Nixx generate config command to initialize a very basic flake with a Nexus configuration for current hardware without file systems. Now let's open our flake. And here we just need to add two inputs. Preservation the tool we will use to preserve files and directories from getting wiped out and disco installation and formatting tool. Then let's include their modules in the modules of our Nix configuration. And while we're at it, let's also create in reference a preservation.nix file where we will set some Nexos options for preservation and a disco.nix file with options for disco. The flake is pretty much finished and now we can navigate to our disco.nix file and start declaring our file system. This file will get pretty large in a moment. So I suggest you to just copy it from the website.
But either way, we will go through all the options together just so we understand what they do. Starting with our ephemeral root which we can declare by setting the disco node dev device at root directory to temp fs. This way all the content of our root directory will be stored on RAM and thus wiped out on every reboot. The size mount option here defines the maximum amount of RAM our root directory will be allowed to take.
So you can generally safely put it at anything from 25 to 50%. But either way you're looking at about 50 megabytes of junk on startup. So unless you decide to download some huge file in one of unpreserved directories, this limit will hardly ever be a problem. Then to persist some of our files in directories, we will define our main device, which in my case is a virtual/dev/bda drive because I'm doing this in a virtual machine. But on real hardware, you will likely have something like /dev/nvme something ordev/ sda. You can use a regular Linux lsbk command in another terminal window to find out. This is the most important option in this file, so make sure it matches your disk name correctly. Now, let's give our disc a GPT partition table. Fill it with boot and ESP partitions to reliably boot on modern hardware. A swap partition with as many gigs of memory as you want to allocate to swap. I recommend roughly matching your memory size here. And finally, the most important root partition with a better FS file system.
This partition will have two subm modules /nix mounted at /nix the next store directory required for boot and/persistent mounted at /persistent the place where we will store all the files and directories we want to persist. Then to make sure we don't boot before/nix is mounted. Let's also mark it as needed for boot with a separate option at the top. And now this file is ready to go. So let's proceed to the preservation.nix file. Here let's enable preservation with a simple enable option and declare a preserve at/persistent option to start declaring the directories we will preserve in the /persistent directory. Inside we have access to two simple files and directories options allowing you to dump names here without putting too much thought into it. The recommended simple configuration looks something like this.
Preserving machine ID and some Nexo state. But you can continue by adding more imperative stuff like Bluetooth or network connections. Additionally, I can suggest adding /temp directory here because it's widely used by some build tools and editors and may accidentally fill up your temps if you compile some big video or try to build some big project. Cleaning/temp has never been a problem anyway. And finally, we can also declare user files here by simply using the users do username.files option and users do username. directories option.
You probably won't know which exact files and directories you want to preserve here right away, but you can always return to this file and make changes later. When you are done declaring the initial directories you want to preserve, we can finally move on to our generated configuration.nix file where just like with any other normal Nixers configuration, you just need to set some options for your time zone, your packages, your user, and so on. The generated file will contain many comments, so just go over it and choose the ones you like. The only option I highly recommend you to set here is your user's initial password because this will ensure you can successfully login after the installation. Later you can safely switch to using an imperative password or to a hash password file in the persistent directory. The basic Nixs configuration is ready and now we can finally run this giant Nixon disco command which will evaluate our Nix configuration. Use disco to format a selected disc and install Nexus on it right away. So just make sure that the disk name is correct in the command and run it. After the installation, let's not forget to copy our final configuration to our disk. And to do that, we first need to check the output of the lsbk command, which should now show a fully formatted disc with Nexos.
There we need to locate the largest partition, which in my case is VDA4.
Mount it with this command and copy the content of your working directory to / mnt/s/nixos.
This will put the configuration in / etsy/nixos in the end. Then simply reboot your machine and you are in.
Simple as that. You now have a very basic impermanent setup. And now let's go over some quick tips on using such setup. First, it's probably worth mentioning that if you declare any settings or files with home manager module or yam, you don't have to preserve those files with preservation.
They will get activated on every reboot along with your configuration. Second, the easiest and most reliable way to declare a password on such setup is to simply use the hashed password file option. So you can just generate a password in the persistent directory with a command like this and then read that password with an option. Just do it after the setup so you have a fallback generation. And finally know that you can absolutely persist any directories with all their content. So it's perfectly fine to preserve the entire documents directory or the entire neoim state directory. You don't have to hunt down individual files. For more tips and commands, you can visit the vimjer.com website. I will try to keep it updated with more stuff later. And if you have any trouble reproducing the setup, find me on our Discord server. I chat there every day, so ping me whenever you want.
And now, I'd like to thank all the amazing people that support the channel and keep it going for all the amazing monthly and recent donations. They really mean the world to me. As you can see, I've been working on adding avatars to this section. So unlike previously, it is now fully generated from coffee and YouTube provided CSV files with avatars being fetched from Discord. For some reason, coffee doesn't have a sane API for fetching avatars without using web hooks and setting up an always online server, but I think Discord avatars is a good enough alternative. I will also try to include support for YouTube avatars and one-time supporter avatars later, but that just requires a little bit more work. So, as always, don't forget to check out our Discord server, leave a like or a comment if you enjoyed this video, or subscribe if you're feeling extra generous. Thanks for watching and I'll see you in the next
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 viewsβ’2026-05-28
How agent o11y differs from traditional o11y β Phil Hetzel, Braintrust
aiDotEngineer
450 viewsβ’2026-05-28
Re: π£οΈπthepropheduπ2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 viewsβ’2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanationπ―β
LearnwithSahera
1K viewsβ’2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 viewsβ’2026-05-29
Search Algorithms Explained in 60 Seconds! π€π¨
samarthtuliofficial
218 viewsβ’2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 viewsβ’2026-05-30
Instagram accounts got PWNed
EricParker
13K viewsβ’2026-06-03











