this post was submitted on 06 Jan 2025
73 points (97.4% liked)

Nix / NixOS

1854 readers
10 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

After around 4 months of reading manuals, forums, watching tutorials and asking online, I've eventually managed to have an almost properly working NixOS installation on my pc and wiped the Win10 partition (I have win10 in a VM as a fallback mechanism)!

I started this journey initially wanting to switch to linux and I started my tests with Debian Stable. But the repo was really old (as expected), so I tried the Testing variant. But this repo had missing packages. I tried Unstable for a few moments too, but I crashed and didn't want to bother. I figured that I could make a script to (declaratively?) fetch and auto update packages from github, bypassing Debian Testing.

Then it was when I looked at NixOS and found out that the whole system kinda does what my script would do, but much much much better. Almost ever since then I tried to learn almost everything I needed and a few extra stuff to get it working. This is the configuration I've come up with so far (it's probably considered simple).

I also made a guide to keep track of what I was doing and what I would have to do once I took the decision to transition to Linux/NixOS, hopefully it might help others too:

https://codeberg.org/BlastboomStrice/LinuxPlan/src/branch/main/LinuxPlan.md

Finally I can be called a Linux user :)

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 11 points 2 days ago (3 children)

Nice! I'd still love to switch to Nix, but that learning curve is steep, and every time I try to learn it, I still feel mystified by the end of it. Any tips?

[–] [email protected] 4 points 1 day ago (1 children)

Start ny NOT jumping into nixos. Start using home manager on whatever distro you currently use. Then slowly move whatever programs or dots you currently have over to it, uninstall the aur/apt packages as you define them in nix. At first you'll have a clear goal: emulate your user environment. Once you've got your user environment defined, the jump to nixos would be easy (if you even want to) because you can use your home-manager config as the starting point. And depending on how you use your computer, home-manager may end up being most of what you care about.

[–] [email protected] 2 points 1 day ago

Ah, interesting. I'd heard of home manager, but I don't know much about it. Sounds like I should take a look!

[–] [email protected] 15 points 2 days ago (2 children)

Use home manager + flakes immediately when you feel confident in using them, that's practically a requirement to make a good home config.

A good channel that got me off the right foot is vimjoyer on youtube, you should check his nixos guide.

Can't forget about the NixOS wiki :).

Good luck with nixos, it's 100% worth it.

[–] [email protected] 6 points 1 day ago* (last edited 1 day ago) (1 children)

@[email protected], I second starting out with Home Manager on your current Linux or Mac. It's a great way to learn all about Nix, while keeping the option to move back to a shell that is not managed by Nix and having the option to go back to a shell that is not managed by Nix (I had zsh in Nix, and Bash native) and still being able to boot your pc when you mess up in Nix.

The real advantage, as @[email protected] said, is in being able to use recent packages on any Linux and MacOS. Home Manager gives you that. I first started with a basic Home Manager config, then learned about the Nix language using some simole puzzles (the first Advent Of Code days), then the module system, finally flakes so I can use packages from 24.11 stable in Home Manager on top of other Linux OSes.

This way I could take it step by step instead of the rocket jump that OP did. Hats off btw @[email protected] , you provide amazing value with your nixos plan!

[–] [email protected] 3 points 1 day ago

Hihi, you're welcome!🤭

[–] [email protected] 6 points 1 day ago* (last edited 1 day ago)

Strongly second this recommendation. One of the biggest benefits of nix is being able to use the package manager on Linux/MacOS. You can quite literally start out by simply porting whole config files into the nix store. Just copy the file into your nix configs repo and have nix create the symlink.

I personally play around with these via imports. Say I want to start configuring Firefox via home-manager. I could start with configuring Firefox manually, then storing my raw /home/luc/.mozilla/firefox/profiles.ini in my nix store by the method above via a file called firefox-native.nix. Then in firefox.nix I play around with parameters in the nix config. If I hit a wall and don't have time to figure out the "real" nix configs, I just switch my import over from:

# home.nix
imports = [ ./firefox.nix ]; # the nix way

to:

# home.nix
imports = [ ./firefox-native.nix ]; # fallback - known working native config file

Don't forget about the Discourse page! I've found folks there to be very friendly and helpful.

Other useful tools are: search.nixos.org - for seeing if a package exists. mynixos - for exploring options within a program/service configuration.

[–] [email protected] 6 points 2 days ago

Hm, I see, it can be difficult.

Before those 4 months, I knew almost nothing about linux. Like, just a very few basic commands and I had managed to follow a random portuguese video (using translated subtitles) about compiling an android kernel on Ubuntu to root my device (had ~no idea what I was doing).

Around September I first installed Debian in a VM on windows (virtualbox) and tried to replicate my windows usage on debian.

I started writing the markdown guide I shared in my post in order to keep track of things and know how to re do what I did.

Around October I steeree towards NixOS and also started using linux on dual boot (on an external ssd), because the VM was too slow for my needs.

Gradually (while taking notes in the guide) I got almost everything working on NixOS, took my backups and precautions and a few days ago I decided to wipe Windows and replace thek with NixOS. It has been a somewhat intense 3 days dealing with configuring NixOS (I didn't account for all of my use cases and forgot to do some stuff, which delayed me further), but eventually I made it :)

So, I suppose it needs patience, will to learn and probably most importantly free time. Maybe you can find anything useful in the guide (at the end I have listed loooots of bookmarks I kept, in case you want resources). I'm also not very sure if knowing linux would help, as I don't know if I would attempt to use NixOS, had I spent days configuring another distro previously.😄