Some Questions about NixOS

Hi, I am an intermediate to advanced Linux user, and I used Arch for several years. Recently, I found out about NixOS and I have started to dabble with it on an old laptop. I have considered getting it on my main machine several times, but I haven’t done so yet… even on my laptop, I have been considering moving back to Arch several times.

My main issues are not too many, but some are quite a dealbreaker for me. For example:

  • I haven’t been able, to get appimg to work, which I need for some work tools.
  • I am a developer and albeit I am mostly doing Java, C++, JavaScript, jQuery, node.js and Ruby, I do occasionally need Python and I heard, that Python and NixOS are a real PITA.
  • I am using kmail, kontact, kaddressbook, akregator etc. as organizer for mails, contacts, rss, etc. However, even when switching to experimental, I get a warning, that these tools are outdated.
  • I got some issues with icons to display properly. Mainly Lutris for example, doesn’t show a tray icon and many icons are messed up or not showing properly.

This is it about my issues. Then there are some more basic questions… like, do I need home manager or not? What are the advantages of it? And finally, I am curious, if NixOS works well with an older system. I am running a 4th gen i5 with 8 GB RAM, and so I am wondering, if there are any issues, performance wise.

Also, I am curious, if it is really worth to change to NixOS from Arch. I mean, for me and my use case, which is mainly browsing web, developing and gaming, is it worth the trouble? Are there any advantages, for me, that particularly stick out or outweigh the disadvantages?

I have Arch setup with snapper for automatic snapshots… I know this won’t be necessary for NixOS, which is one of my biggest points in favor it.

So I guess, I am just curious about the answers I get and hopefully then will be able to make a decision.

Cheers,

Ben

You should be familiar with Arch Linux’s Code of Conduct, so I would first recommend checking out NixOS Wiki and trying to do your own research, which shouldn’t be hard for a Arch user.

If you are unsure about NixOS as a whole, you can first install Nix and home-manager in Arch and evaluate if Nix is beneficial to your workflow.

I did spend quite a while reading through the Wiki and I was able, to get the system running on the laptop pretty much as I want…

Still, I have been unable to fix the icon / theme issue and also I wasn’t able to run AppImg files and I have not been able to fix kmail being outdated… I have found some topics, saying, that the Kontakt suite has been replaced by Merkuro, but that’s not what KDE says. Both are meant to coexist with each other and also Merkuro is still in beta, with only the calendar working. Arch has up to date Kontact, which is why I was asking.

Overall, I know what NixOS does and I kind of like it… but those concerns mentioned above, are something, I would like to fix… if it is possible, I would move my other machine over… if it is not… well, I would probably hold off on moving.

What Appimage file are you trying to run? What’s the error?

I don’t have it on my machine (nixos-unstable) so please share the warning you saw.

Please share technical details and a minimal reproducible example or your config.

I am trying to run Shadow Drive. A file sync service, similiar to gdrive, we use to sync work stuff between different machines. It just doesn’t start. Says can’t be executed, even though it’s marked as such.

It is just a banner on top of the app, for example kmail. I will switch to unsable and try again, to make sure and post a screenshot of the banner.

Which only leaves one remaining issue… the missing / messed up icons on Plasma. It’s not a big deal, but it is quite annoying. It does not happen on Arch with the exact same setup, so I am not sure, what is causing it… if something is stored differently in Plasma on Arch, than it is on NixOS.

Thanks for your help so far, btw… I appreciate it and I hope, I can solve this, because I would really like to switch over to NixOS, mainly because of its reliability. I did consider running Nix on Arch, but I think, I prefer the all-in option, though, if I can’t fix the current issues, this is what I probably will be doing.

EDIT: I just realized, I cannot run Nix on my Arch System, at least not as multiuser setup, since I am using Arch with mkinitcpio and with GRUB.

Take a look at Appimage - NixOS Wiki to see if it helps.
I don’t use Appimage at the moment, but I think you may need appimage-run (a package) or programs.appimage.binfmt (a NixOS option).

I do occasionally met this. For me a reboot will solve it, and I think the reason may be the fact that after an app is updated, the old package (derivation) may be garbage-collected so the .desktop file could not longer be found. After activating the new generation the new .desktop file will replace the old one and the icon issue will be fixed.

Heh… I guess you convinced me.

I will give it a try and install NixOS on my main machine. I really like the OS… I just feel somewhat like a complete noob again lol, which being quite familiar with Arch and configuring it, is a pretty funny experience…

As for the missing / messed up images, a reboot on the laptop did never fix it. It’s most notable with Lutris… it shows up in the App Runner, but if you start it, there is no tray icon for it at all… unlike Arch and any other distros I know of. Then, if I go to runners for example, there is supposed to be a little cog wheel for settings, which looks fine and a small icon, which looks like a little lighter I guess… this is not showing at all in my NixOS installation. Instead I get the pamac icon (green and white circle with arrow in it), which on top of it, is oversized, like the icon, that’s usually in the App Runner.

You wouldn’t have to snapshot system configuration states, sure, but you still need to back up your data. Including data generated by system services.

IMO they’re not bad, see Ad hoc shell environments — nix.dev documentation and Declarative shell environments with shell.nix — nix.dev documentation.

NixOS is using a programming language to configure a “correctly deployed” system (see Section 1.1 of https://edolstra.github.io/pubs/phd-thesis.pdf for a definition of what is meant by this term.)

If you think that’s something you want to muck about with, then yes, it’s worth it.
Otherwise, I’d say it’s hard to justify.

My take is - some things are actually easier (i.e. less boilerplate and more predictable) to configure compared to Arch, and 90% of my headaches are about Linux overall rather than some NixOS-specific issue. (There are still that 10%, like general lack of support for some configurations.) But I’m speaking as someone now comfortable with the language, the NixOS module system, and packaging in general, and the learning curve for all that can be rough.

Be patient, use a secondary system for NixOS, don’t switch when you’re in the last week before an important deadline, and the learning might be less frustrating.

1 Like

I was an Arch user, so I felt the same. NixOS is indeed very different from other distributions and there are many new things to learn, which is why I suggest trying out Nix itself first, as you can get yourself prepared for the final switch.

As for the icons issue, it might be helpful if you could run the app from the command line and paste its log, and also make a screenshot of the icon you saw?

1 Like

Hi @Prince213,

thanks for your reply and sorry for being a bit late. I did decide to give it a go yesterday and got NixOS installed on my main machine… spent the day, setting it up, reading stuff and even got my first flake working nicely. All great so far, on that end.

I was able to run AppImages, but I don’t like the idea, that I have to start them manually. At least the cloud sync service, would be nice, if it would autostart. I read about the wrapper in the manual and Wiki, but I don’t think, I really figured out how that works. Would a wrapper be possible in this case, to achieve, what I want?

Also, there is one package, I need, which is not in the repos. I know, I can request it, since deb and rpm versions exist. However, there is no source code or tarball. I wonder, if there is a way for me, to create a Nix package myself? The package isn’t available for Arch either, not even in the AUR, and for Arch, I created an AUR package for it. So I wonder, if something similar can be done in this case.

As for my issues:

Kmail works fine now, there is no warning about it being outdated and not having been updated for a long time. So this worked well… Thanks!!

However, the issue with the icons, seems to be still there. Here is a screenshot of what I mean, using Lutris (unstable) as an example:

image

How it is supposed to be:
image

There is also no tray icon:
image

Other than that, I am pretty much set… I set up some aliases and configured automatic garbage collection. I did also set up zsh, but I have a question here, regarding an error. When I start konsole, I get the following error:

Warning: Could not find '', starting '/run/current-system/sw/bin/zsh' instead.  Please check your profile settings.

I checked my profile and noticed, that the command field was empty, so I put it:

/usr/bin/zsh

However, this did not get rid of the error… instead of ‘’ it now showed ‘/usr/bin/zsh’ but other than that, the error was still the same. So I changed command to:

/run/current-system/sw/bin/zsh

That fixed the error, but I am not sure, if this is supposed to be done this way, or if there is another, «correct» way of doing this. There are also two errors about not found plugins (I am using ohMyZsh:

[oh-my-zsh] plugin 'zsh-autosuggestions' not found
[oh-my-zsh] plugin 'zsh-autocomplete' not found
[oh-my-zsh] plugin 'zsh-autosuggestions' not found
[oh-my-zsh] plugin 'zsh-autocorrection' not found
[oh-my-zsh] plugin 'zsh-powerlevel10k' not found

This is particularly interesting, because I never defined zsh-powerlevel10k as a plugin in my config. As for zsh-autocorrection and zsh-autosuggestions, both packages are installed. This is my config:

 # Enable ZSH
  programs.zsh = {
    enable = true;
    enableCompletion = true;
    autosuggestions.enable= true;
    syntaxHighlighting.enable = true;
    promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
    shellAliases = {
      update = "sudo nixos-rebuild switch";
    };

    #history.size = 10000;
    #zshrcExtra = ''fastfetch'';

    ohMyZsh = {
      enable = true;
      plugins = ["git" "zsh-autosuggestions" "zsh-autocomplete"];
    };
  };

  users.defaultUserShell = pkgs.zsh;
  users.users.bbuske.shell = pkgs.zsh;

It does read my zshrc fine, since it shows fastfech and my custom style:

Other than that, I am quite happy with the setup and it has been a cool and rewarding experience… I know there will be a lot of work ahead, as I want to look into adding more flakes and maybe set up home manager in the future… but the experience has been really smooth and nice so far.

Sorry in advance for this long post… :slight_smile:

Cheers,

Ben

I think you can just add the appimage as a normal app in KDE settings under the Autostart tab. If that doesn’t work, enable programs.appimage.binfmt and try again.

Yes, in this case you simply create a derivation to unpack the deb, then patch things like hardcoded paths etc. Search e.g. /\.deb/ in nixpkgs to see how it’s done in practice.

NixOS isn’t FHS compliant. This is why /usr/bin/bash won’t work and we need to patch interpreter paths. Maybe just use zsh for the field if you are concerned.

You need something like programs.zsh.autosuggestion.enable. I think it’s generally not a bad idea to prefer options if they are available.

This doesn’t seem to work:

It doesn’t throw an error, but it doesn’t start either.

  # Enable AppImages
  programs.appimage.binfmt = true;

The same is true for the toolbox, but that’s unrelated, as it is not an appimage but an app from the Nix Store. I will look into that later.

Not necessarily concerned… just wondering if this was the right way to have it done. zsh works as well though, so I just stick with that. Thanks… :smile:

I think it is:

  # Enable ZSH
  programs.zsh = {
    enable = true;
    enableCompletion = true;
    autosuggestions.enable= true;
    syntaxHighlighting.enable = true;
    promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
    shellAliases = {
      update = "sudo nixos-rebuild switch";
      clean1d = "sudo nix-env --delete-generations 1d";
      cleanall = "sudo nix-env --delete-generations old";
      garbagec = "sudo nix-store --gc";
    };

    #history.size = 10000;
    #zshrcExtra = ''fastfetch'';

    ohMyZsh = {
      enable = true;
      plugins = ["git" "zsh-autosuggestions" "zsh-autocomplete"];
    };
  };

The autosuggestions.enable= true; in this snippet should do the same as programs.zsh-autosuggestions.enable, I think? Or am I wrong?

As for the options, you would first search for an option I guess, than you search for a package, right? Options are a cool thing, I use them for steam and whenever I find one for what I need, as they make things easier.

Cheers

You are right. I overlooked that. Did you try removing the two plugins from ohMyZsh.plugins? I think (correct me if I’m wrong) ohMyZsh is only responsible for loading them, which is already done by Nix.

Correct. They usually handle more than just package installation: shell init script, systemd services, etc.

Home-manager is basically GNU Stow on steroids if you know that one.
Meaning you can setup your user configuration in a declarative way.
Either on NixOS or on any other Linux distro you want. At work we use it on Ubuntu for example.

Performance should be fine, I use it on multiple Raspberry Pi for and it works fine.
I feel 8 GB RAM aren’t that much for a desktop system but if your current distro runs NixOS won’t be much different.

As for being worth it that is entirely for you to decide. I personally won’t ever switch back to a non-declarative distro. I recently got a new notebook and the hole migration took less than an hour and I never had to think about setting up my software. I only had to fix a few issues related to it being new hardware and that’s it (which then took me two weeks but that would have been the same on any distro).

Heh! Thanks @Prince213 , that did it!
Interesting, I didn’t realize NixOS would deal with the plugins. Especially, since I followed the Wiki and it had it set up like this… but the Wiki example was for home-manager systems, which I don’t have (yet).

Pretty cool. I used them for quite some stuff and not for other, until I realized, I can search for options… lol, so I did make some changes.

Is there a way, to install several packages from a set or group? For example, there are about 50 KDE apps I use, which I added manually to the config… and it was pretty tedious, albeit a one time thing. So just curious.

And could you maybe elaborate a bit more on this:

I didn’t find anything. Or do I just search .deb? Confused by the slashes.

Also, I would like to say, that even though I didn’t spend too much time with all the stuff yet… I got a huge reading list and a browser with several tabs open, to delve a bit more into Nix and NixOS. Still, I can say, that I am quite happy with the system. Once you know the basics of how stuff works, it’s not too difficult either… but of course as someone who writes code, this is all not really too new as well… That said, I really like NixOS mainly because of its immutable nature and because of it being declarative. Add to that reliability and its a perfect fit.

The learning curve will be pretty long probably… and there is tons of stuff to learn still, but I am looking forward to it… I have tried many distros, but for the past 8 years or so, I have been switching between Arch and EndeavourOS (with a short stint on Manjaro). If I felt like going through Arch install (which is not too hard if you have done it a couple of times), I did Arch. If I didn’t, I did EOS. Whenever I messed around with other distros, like Fedora or openSUSE, I usually ended up being back on Arch within the same or the next day. Just not my cup of tea and often prone to issues… I didn’t expect, to ever move away from Arch, but I didn’t know about NixOS, until like two weeks ago or so… I noticed it coming up once in a while in the Arch and EOS Reddit and in DistroHoppers and someone at some point said, that it was reliable and immutable. Which is when I got curious, took a look at it and put it on my laptop.

More than a day has passed, and I am still on NixOS, so chances are, I won’t be moving away. :smiley: Thanks for the help and well, I am sure this wasn’t the last time, I will need it.

Just gotta see if I can fix the stupid Shadow Drive and the Icons, though now it seems to be only Lutris, so this is not a big deal. Maybe I try the flatpak.

Cheers and thanks again.

Thanks for your reply. I got convinced and decided to try it yesterday. So far I am happy, but I am not using homemanager yet. This is something, I will do in the future. I did create a flake though. :smiley:

As for the computer, its just a work PC with some light gaming down. Mostly Lutris DOS games. Nothing too big… I might upgrqade it later and it will be fun, not to have to set everything up again.

Is there an option in Konsole to just use your user’s login shell, instead of explicitly specifying some executable? I would say that would be the most conventional way. You would then set your user’s shell either:

  • Imperatively as in other distros (i.e. chsh)
  • Declaratively via the NixOS config, i.e. users.users.jsmith.shell = pkgs.zsh
1 Like

Could just set it to $SHELL here, I think.

There is kdePackages that has many KDE 6 apps & libs. But there may not be a package set that has the exact packages you want, so you would need to specify a list (to include or exclude) anyway.

Sorry about that. I mean you can just search the word .deb (slashes were for regex though), like typing repo:NixOS/nixpkgs /\.deb/ into github search bar.

1 Like

Thanks. I fixed it by just adding zsh @justinas

What I thought… so it’s probably fine the way it is… It’s just something you need to do once anyway and even in Arch you have to install them individually… you can do pacman -S kde-applications, but that will give you a list with most (not all KDE applications) and you would still have to select them individually or by smaller groups (1,2,5-10), unless you want to install them all… I think the NixOS way is actually a bit easier and I like that I never have to do it again.

No worries, I imagined it was regex, but I used search.nixos.org and not github, and there the regex didn’t work, the .deb did… :slight_smile: I will have a look at that. Thanks!