Talk me out of (or into?) quitting nixos

I got a new T495 on Wednesday and I’m over the moon for it. I installed nixos on Thursday after I got a larger ssd, and I’ve been setting it up since.

I just feel so lost with every little thing. I moved here from Debian on an old T520. I did most things in the terminal on that machine, as it was nearly ten years old.

Here I’m not sure how to integrate my old installation techniques, troubleshooting techniques, config techniques. I feel like I just keep hitting walls.

I think one of the main issues is that I’m really not a coder (yet). I didn’t realize how much of the setup is straight up coding. I’m wondering if I should just come back to this once I’m a better coder. I’m usually one to persevere, but I’ve got a lot on my plate right now and just need my computer to work.

2 Likes

You can use nixpkgs alongside other linux distributions. I think that would give you biggest “bang for the buck” in terms of time if you just want to use something like nix-shell or home-manager.

The main benefit of nixos is that you can describe your entire system as a single configuration. However, for user environments, this can be largely done with just home-manager.

I guess the question is, what are you hoping to gain by switching to nixos?

6 Likes

Thanks so much for replying.

I LOVE the portability. Do I need it? Probably not. But it blows my mind. I just love the declarative system config, but I’m not good at it yet, and I wonder if I’m reaching diminishing returns at current programming level.

Here are some things I’ve struggled with:

-integrating configs from all of my programs
-initializing programs at startup
-audio and video
-installing software outside of the config file

I know (suspect?) that I could do all of this if I RTFM, but it doesn’t feel like an option, temporally or energetically. What’s more, my perfectionism is getting in the way. I feel like if I set up anything outside of the nixos system config then I’m doing it wrong. Should I just suck it up and start dropping my dot files in the home directory? Would that even work?

nixos has the concept of modules which usually takes care of this. These usually get translated to systemd units which start after boot.

I’ve had little trouble with video, but audio has been annoying with system suspension. Sometimes need to do pulseaudio --kill; pulseaudio --start for everything to register correctly. But I think I’ve had similar issues with ubuntu in the past.

Precompiled programs are an issue. Usually you can get away with using the steam-run utility to create an FHS environment which the program can use.

I understand. And there’s a lot of ground to cover depending on your background.

I use home-manager to manage my home directory. You can look at what I do: GitHub - jonringer/nixpkgs-config: ~/.config/nixpkgs . If that seems like too much effort, then just ignore it.

4 Likes

I just love the declarative system config, but I’m not good at it yet

If you are likely to become significantly more comfortable with programming in the medium term: yes, it will probably get better then.

Your list looks like your problems are exactly with the OS part of NixOS; you can have multiple Nix-managed sandboxes on a normal distribution and just let whatever you are used to manage the video drivers.

Also maybe with time you will learn how to install the binary software via Nix well enough that installing software outside of the config (and outside of nix-shell / buildFHSUserEnv) becomes a rarer need…

Dotfiles in VCS are more important than generating all of them — use home-manager where it feels to make sense, and just version-control the rest in one way or another.

3 Likes

I think “jonringer” already gave a detailed answer to your problems. I totally comply to his views.

Perhaps your problems relate more to moving from T520@Debian to T495@Nixos?

If so, it would be of interest which version of Debian you had been using. If it had been a dated one not using systemd, I do think your init scripts might be somehow be incorporated into the OS start process with systemd.

You might find some missing application on Flathub. You would just need to enable flatpak.

services.flatpak.enable = true ;

I do believe if you’ve managed to get past the installation, you’ve nearly made it.

1 Like

It’d be helpful if you would describe specific issues you have. Can’t really tell you what to do if you don’t tell us what you need.

holy crap this community is amazing. I guess I’ll make some separate threads for my separate issues. (at the risk of spamming the site :worried:)

3 Likes

That is a reality of nixos for most people with existing Linux experience.

The simple truth is that nixos is going to put a bunch of walls in front of you in the beginning. For me, the question is, “Are they worth overcoming?”. Only you can answer that.

Are you sure you need to do this?

The learning curve will be a lot easier if you first learn to use nixos without trying to learn home-manager at the same time. Without home-manager, nixos will work like most distros in daily use with the exception of system administration tasks like installing software, creating services and system-wide configuration.

On the other hand, reproducibility is a lot higher with home-manager in the picture.

2 Likes

If I may give you my personal view: Like you, what drove me to nixos is the declarative format: it’s revolutionary. Although it took me time to feel at home, I don’t regret the time invested.

I was > 99% sure I wanted to learn nixos. So my aim was not to have 100% of my dream configuration written in nix expressions in a few days: My aim was to have an acceptable configuration and to improve it using nix.

It’s up to you to decide what is “my computer to work”: does it mean exactly like you want, or does it mean you are ok to adapt.

My personal journey was to choose the bare minimum tools to perform my necessary tasks, even if a bit awkwardly at the start. And then probably daily I have added little improvments, and it has guided my learning of nix all along.

Honestly it took me more time than I thought to grasp several things in nix. But the configuration I have today is so much more bulletproof that whatever I have had before…

7 Likes

Something I did to learn more easily Nix without breaking everything was to create a VirtualBox instance of NixOS, and started a Git that hosts my Nix configuration.
As it is reproductible, you can start building your custom configuration (by separating what is about the device and what is about your configuration) in your VM, destroy it, tweak it, restart it without the hassle of having your whole system impacted. I even started to do to on my Arch to discover and move slowly to our favorite OS :slight_smile:
I even switched to the unstable at the first time just to have the latest stuff, and slowly came back to the stable as my skills with the Nix language improved.

So my recommandation as a newbie are:

  • Use a VM to tweak stuff and discover easily NixOS at the first place
  • Don’t use HomeManager right now as it is an extension of Nix, and is not mandatory to have a great setup
  • Try not to start a program if it is not packaged. Ask the community to make the package or to help you making the package. I did it for ULauncher, and people made it fully packaged in about a weak. Great community :stuck_out_tongue:
5 Likes

I’ve really liked just using Nix on alternative Linux distributions (Fedora?).
Most of the time the reproducibility I care about it involves my dot files & packages installed.

Using home-manager gets me far enough for now while I get used to Nix.

I also use this pattern on my work laptop which I’m forced to use anyways a non NixOS distribution.

1 Like

I second that. Instead of using a home-manager less NixOS, I would recommend to start with a nixos-less home-manager. Much easier to get accustomed to it gradually, since you can easily manage only part of your home with it. Contrast that to NixOS, where you have to set up your entire system config in one go.

I think the smoothest transition would be

  1. Install nix, play with it a bit, get familiar with it. Use nix-shell (but probably avoid nix-env). Get hooked.
  2. Install home-manager. Install some packages, configure some user services. No need to hurry, you can take it one package / service at a time. You can keep using your old config for the rest. Notice that you don’t actually need much system-wide config, most of the interesting things can be done at the home-manager level.
  3. Once you have moved most config to the user-level anyway and aquired some nix experience, do the jump to NixOS (if you even want to do that). Should be much easier now. You can also build your configuration.nix in a VM first.
7 Likes

If you are going to install NixOS on your laptop, I would suggest that you should set powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"
in configuration.nix, otherwise your laptop will always run at maximum clock freq

2 Likes

That should be autogenerated by nixos-generate-config

1 Like

Don’t get bogged down - just do home-manager or nix-shell to start.
:slight_smile:

1 Like

I actually got fed up and switched to Debian. …but after a week I switched back and now I’m very very happily running nixos.

I still have some kinks to work out, but they are mostly new-laptop issues, not nixos issues.

The main thing for me was learning (from a friend who is a nixos fanatic) that nixos excels at system-wide config. I thought I was doing everything wrong because I couldn’t figure out how to get nixos to configure my user settings. I really believe that that needs to be clearer. And that maybe home-manager needs to get merged and rebranded.

8 Likes

I think “I tried, it was painful, but for some reason I came back and it stuck” is a common NixOS story. I’ll just speak for myself and say it’s always exciting to see new faces, especially in Discourse/IRC/etc, welcome (back)!

Just a note, the “system settings” conversation can get a bit muddled as a number of NixOS modules are capable of configuring “user applications” but they do so by changing the global configuration, thereby affecting all users. I myself am a recent adopter of Home-Manager and I kind of agree that the full picture is a bit more clear when NixOS+Home-Manager are both used.

5 Likes

Taking a step back, I think it’s really cool that an individual (in this case @rycee ) was able to re-use most of the machinery around NixOS and created something that was could be used per-user in a platform-independent way.

9 Likes

I setup a P53 with Nix and i3 works really well.
Check config and you may find some useful configurations.