this post was submitted on 01 Jun 2024
49 points (94.5% liked)

Nix / NixOS

1739 readers
1 users here now

Main links

Videos

founded 1 year ago
MODERATORS
 

I recently tried switching from Arch to NixOS and the experience I had can best be described as apalling. I have not had a new user experience this bad since my first dip into Ubuntu dependency hell back in 2016. I'd like to preface this by saying I've been a Linux user in one form or another for almost half my life at this point, and in that time this may well be the most I've struggled to get things to work.

Apparently they have this thing called home-manager which looks pretty cool. I'd like to give that a shot. Apparently I have to enable a new Nix channel before I can install it. I'm guessing that's the equivalent of a PPA? Well, alright. nix-channel --add ..., nix-channel --update (oh, so it waits until now to tell me I typo'd the URL. Alright), and now to run the installation command and... couldn't find home-manager? Huh?? I just installed it. I google the error message and apparently you have to reboot after adding a new nix-channel and doing nix-channel --update before it will actually take effect, and the home-manager guide didn't tell me that. Ah well, at least it works now.

I didn't want to wait for KDE and its 6 morbillion dependencies to download, so I opted for Weston. It wasn't a thing in configuration.nix (programs.weston.enable=true; threw an error and there was no page for it on the NixOS wiki), but it was available in nix-env (side note: why does nix-env -i take upwards of 30 seconds just to locate a package?), so I installed it, tried to run it, and promptly got an inscrutable "Permission denied" error with one Google result that had gone unresolved. Oh well, that's alright, I guess that's not supported just yet -- I'll install Sway instead. Great, now I have a GUI and all I need is a browser. nix-env -i firefox gave me the firefox-beta binary which displayed the crash reporter before even opening a browser window. Okay, note to self: always use configuration.nix. One programs.firefox.enable=true; and one nixos-rebuild switch later, I'm off to the races. Browser is up and running. Success! Now I'd like to install a Rust development environment so I can get back to work. According to NixOS wiki, I can copy paste this incantation into a shell.nix file and have rustup in there. Cool. After resolving a few minor hangups regarding compiler version, manually telling rustc where the linker is, and telling nix-shell that I also need cmake (which was thankfully pretty easy), I'm met with a "missing pkg-config file for openssl" error that I have absolutely no idea how to begin to resolve.

I'm trying to stick with it, I really am -- I love the idea that I can just copy my entire configuration to a brand new install by copying one file and the contents of my home directory and have it be effectively the same machine -- but I'm really struggling here. Surely people wouldn't rave about NixOS as much as they do if it was really this bad? What am I doing wrong?

Also unrelated but am I correct in assuming that I cannot install KDE without also installing the X server?

you are viewing a single comment's thread
view the rest of the comments
[–] kyleraykbs@lemmy.ml 5 points 5 months ago (13 children)

Hello! Made a Lemmy account to comment on this, I've been a long time lurker. As someone who also went into Nix blind, its always gonna be a hard time a first, its a super different paradigm then anything else out there. Few recommendations,

  1. Use flakes, nix channel is legacy and is imperative meaning nix channel changes won't be copied per system
  2. Try to purify everything, you may not succeed but if you try to nixify everything then you'll get a much better understanding of the underlying systems of nix and of course your is.
  3. Fuck the wiki read the code and other peoples configs. The wiki and the docs have largely been misleading and the nixpkgs code is usually super easy to read, the source is also linked to on search.nixos.org
  4. Use home manager early. Working with NixOS gets better at a rate exponential to the amount NixOS has control over and your home environment is a huge part of that.
  5. Learn modules, all of nixpkgs is made of modules and your system should be as well, if you throw everything into one file you'll have a really hard time generalizing later on, check out vimjoyers channel for this seriously he's great.
  6. Understand that Nix, NixOS and NixLang all are huge upfront investments of time for a time save later on, its absolutely worth it in my opinion but you need to be aware its gonna be very difficult and you should focus on putting your energy towards the parts most important to you. If you have multiple systems you want nix to seamlessly deploy on focus on system relationships like roles, users, flake parts, etc.

And full disclosure once you get over the learning curve it gets easier to write and understand nix, but you realize you did everything poorly and you'll restart.

[–] lord_admiral@lemmy.world 1 points 5 months ago (6 children)

I have a few questions. If your opinion is correct and nix-channels are rotten outdated crap, why aren't they removed from use? Why hasn't any of the nix developers decided to make flakes an integral part of the system yet? I can answer these questions. Any operating system is a complete piece of software only when it follows the developers' backbone logic. At the moment when NixOS becomes a collection of flakes of varying degrees of stupidity, NixOS will cease to exist. Everyone knows and keeps silent that Dolstra started all this nonsense with flakes and home manager only to attract more defectors from other systems. There is no other reason. When a person has worked 30 years in production, he will hardly want to retrain for a new architecture and learn a rather stupid language. The home manager is a crutch written by a third-party developer and its only task is to make the /home folder look familiar to the Arch Linux user. There are no other functions. In the end, all flakes end up in configuration.nix overcomplicating and confusing the configuration. So it's much better to stop chasing other people's hyprland configs and install the recommended ISO, switch to an unstable branch and...read the Wiki.

[–] kyleraykbs@lemmy.ml 1 points 5 months ago (5 children)

Dude what are you on about? Channels are just imperative and that kinda goes against the purpose of nix same deal with why I recommend home manager, if you're gonna do NixOS imo you should do it pure and it sounds like op wants that. The rest of your rant is absolutely unhinged.

[–] lord_admiral@lemmy.world 1 points 5 months ago (1 children)

When dudes use flakes config, they usually disable channels by lock their setup to their/anyone's github. This is kind of how it works.

[–] kyleraykbs@lemmy.ml 1 points 5 months ago (1 children)

I use flakes and I do disable channels yeah but that wasn't what the other 90% of your post was about

[–] lord_admiral@lemmy.world 1 points 5 months ago (1 children)

Can you please tell me how you managed to measure the percentage of "about this" and "not about that" in my comment? In any NixOS community, there are always a bunch of people ready to cut the throat of anyone who says "flakes is dogshit". These are the same people who are always crying "I downloaded flake from some crappy github and now my beloved hyprland doesn't want to work". Is this a coincidence?

[–] kyleraykbs@lemmy.ml 1 points 4 months ago (1 children)

Never seen anyone do that?? But dude if everyone is telling you that your doing it wrong, you might be doing it wrong.

[–] lord_admiral@lemmy.world 1 points 4 months ago

Your problem is that you are drawing the wrong logical conclusions. The crowd can be wrong.Especially if the crowd relies on collective intelligence.

load more comments (3 replies)
load more comments (3 replies)
load more comments (9 replies)