Can I stop NixOS from doublicating Apps after an Update?

While this doesn’t really answer your question, you want want to read this thread to learn about NixOS packages distributions process and leads to make it more efficient How to make Nixpkgs more eco-friendly / use less resources

2 Likes

Wow, I am a little bit overwhelmed not just because I don’t understand every bit of your answer (I get the overall message though) but because every answer is so nice :blush: although this was probably a beginner question.

I compared it to Flatpak cause I was watching DorianDotDash and youtube explaining Flatpak.

Additionally I was watching what I could find about NixOS on Youtube but most of the things are to deep for me (I wish I had this talent and knowledge).
I hope tutorials get a little more beginner friendly as it now has a graphical installer.

@fufexan
I was also reading into the Nix manual and read about “garbage collect”. But it seems like a waste of unnecessary writes to and ssd if not needed. It seems like wasted “work” for the PC.
So compared to an Ubuntu based Distro or Fedora: Do you also get that much Garbage on these systems just not as in Focus as on Nix.
Cause your side note is to much for me but if this is in the works and will be shipped with the NixOS iso at one point that would be nice.
Thanks for the answer of my bonus question. That even I understood :grinning_face_with_smiling_eyes:

@Solene Thanks for the Link

I am still not 100% sure if I could manage the Nix package manager and how to update/upgrade and install (many show installs in the config file) but apt update/upgrade and install seems much easier. At least until I understand it.

Definitely not as much, but they also don’t guarantee that a sudden poweroff during an update won’t break your system.

But it seems like a waste of unnecessary writes to and ssd if not needed. It seems like wasted “work” for the PC.

Yeah, it can come off as unnecessary, but the previous point I made proves that it’s not unnecessary.
Deltas would be a very complex thing to implement in the current model, for (probably) minimal gains.

2 Likes

CAS will not solve any of this issues!

It can only solve redownloads that would otherwise happen if pure buildtime dependencies have changed, and only if a bit by bit identical outcome was created.

Changes in runtime dependencies will always be reflected in changed of the outcome, be it IAS or CAS.

Hmm, is the CAS not chunking the contents? I should look at it in detail at some point, I’d been assuming it works like casync.

It doesn’t chunk, it still addresses a full path.

I don’t think we will ever be able to “chunk” a single huge path into “subpathes” without also rewriting a lot of nixpkgs, to actually produce the chunks rather and combine them in a Linkfarm.

1 Like

There is already some research into increasing substitution granularity: Nix Substitution: the Way Forward

1 Like

Okay, thanks for that. Like I said in my initial comment I probably like NixOS for the “wrong” reasons. For the moment at least.

So the only solution at the moment would be to install additional programs from other sources (Flatpaks, Debs, Snaps etc)?

As NobbZ says, that is not the case. But there is nix-casync:

1 Like

I think GitHub - input-output-hk/spongix: Proxy for Nix Caching is better than nix-casynx in the current state.

1 Like

want to save that space

If you’re tracking unstable, you will end up with quite a fair amount of space used. That can be mitigated by running frequent GC as also mentioned by a few others in here.

and the writes to my ssd.

This isn’t something you should be concerned about or a case that you should be optimizing for (assuming “regular” desktop usage).

Why do I want NixOS?

  • Pure Gnome

What exactly do you mean by “Pure Gnome”? As in vanilla GNOME without any distribution changes? If so, what kind of changes? Because we do patch things a fair bit. Now it might be in ways that do not matter to you, but in order to say anything that addresses this, we need to know what your concern is.

  • Up to Date
  • Low on Ram usage
  • Lots of packages
  • Independent

As an example, you can get all of these with Arch Linux too (I have no idea how many changes/if at all they do to GNOME).

The point I’m trying to get to is this - NixOS does a few things rather differently in order to achieve different goals. If those goals are not important to you (reproducibility, declarative machine configs, roll-backs, very neat dev environments), the trade-offs you would have to make are probably not worth it at this point, but only you can weigh out the pros and cons.

1 Like

Yeah, I meant Vanilla Gnome. How it works and looks. And I thought that you do things under the hood as it uses very little Ram on a fresh boot (not sure about the average load yet).
My only concern was the bandwidth, storage and (in my case unnecessary) writes to the ssd.
But as you said I should not be concerned about the last point.

I would use the Stable. On unstable in Gnome Boxes I was not able to use my keyboard.

I’d prefer not to use Arch mainly cause of the rolling release. I checked Manjaro and Crystal Linux witch both would be pretty good for me if not based on Arch.

I’m complicated. Fedora seems to have many things I am looking for. Downsides are little heavy on the Ram (more than double of NixOS) and origin usa (I’d prefer Europe).

NixOS just seems to be a really good operating system in general and I thought if there is a possibility to turn off or limit these processes that would be nice.

And I thought that you do things under the hood as it uses very little Ram on a fresh boot

We don’t do anything special that would mean significantly lower memory usage, so I wouldn’t use that as a benchmark for this.

If you are running one of the full-fledged DEs (I happen to be using KDE), there really shouldn’t be any significant difference between distributions.

I would use the Stable. On unstable in Gnome Boxes I was not able to use my keyboard.

Then it looks like you’re going to get an unpleasant surprise when the next stable comes around. If you’re able to provide details of what is not working, that would be very helpful (please open an issue).

I’d prefer not to use Arch mainly cause of the rolling release.

Fair enough.

Fedora seems to have many things I am looking for. Downsides are little heavy on the Ram (more than double of NixOS)

Again, assuming you have enabled a similar set of software, the memory use should be similar. Sure, there might be switches that fedora enables that we don’t, but double sounds highly unusual.

and origin usa> (I’d prefer Europe).

I get what you’re trying to say, but what exactly is the concern here? Sure, fedora is run by Red Hat which is a US company, but a big part of the contributors are from !USA. Besides, the software is the same. GNOME is GNOME and GNU coreutils is GNU coreutils regardless of which distribution you are getting it from. >

NixOS just seems to be a really good operating system in general and I thought if there is a possibility to turn off or limit these processes that would be nice.

It is indeed a very good OS and I wouldn’t want to downgrade to a more traditional distribution but that’s for the reasons I outlined in my earlier message.

I’m not in any way trying to talk you out of NixOS. It’s just that if the key USP/UVPs mean nothing to you, it’s probably not worth it. I will recommend focusing on the selection criteria that truly matter to you.

1 Like

In short, the “duplication” is part of a core foundational choice in the architecture of NixOS. If we changed that, it wouldn’t be NixOS anymore, so no, we’re not changing it, and you can’t get around it and still really be running NixOS.

That core choice was made in order to make certain features possible, and those of us attracted to NixOS generally think the tradeoff is well worth it, but if you’re not interested in those features, then, almost by definition, you’re not interested in NixOS, either.

I used both in Gnome Boxes and NixOS was around 590mb while Fedora started at 1GB going to 1.3GB after 2 Minutes (while doing nothing apart from Terminal with TOP open). Both the official (recommended) iso. Same on Ubuntu based Distros all above 1GB while Arch based are a below and OpenSUSE Tumbelweed as well but all of them not as significant as NixOS.
I am not e Dev. I don’t understand why as most of them (with vanilla Gnome) look and feel exactly the same (with some differences in shipped Apps). That can’t be just cause of 3 or 4 different pre installed programs. I don’t get my head around this and I would not know what to do to lower ram usage that much.
And I need my Ram for Design and Photography related things.

Could you give me the Link. I am not sure where exactly to open that issue on Github.
The funny thing is. Somehow Gnome Boxes now automatically chooses “unstable” although I am running Stable 22.05 and my Keyboard does NOT work.
Only thing I do is running the ISO in Gnome Boxes and opening a Terminal after boot. Trying to write gives no respond (none of the keys). I tried other Apps like the Browser and still nothing.
Not sure how I could provide more info as I am not able to do anything in the Terminal.

No real concern. But I am from the Center of Europe and would prefer to support something from Europe. The Two big Operating System Players come from America plus half of the Internet Services most of us use. I am just not a fan of that much Power coming from there and at least Linus Torvalds was born in Finnland.

I make my mind about things I use - sometimes probably too much…

I agree with you that NixOS uses much less resources, compared to something like Ubuntu.
I didn’t specifically check the RAM usage because I have plenty of that but the lesser CPU usage is something that I noticed quite heavily on my VMs.

1 Like

I would like to know why that is. I mean Ram is not very power hungry or activating the fans but CPU is.
10 to 20% of difference would be negligible but 80 to 100% blows my mind.

I used both in Gnome Boxes and NixOS was around 590mb while Fedora started at 1GB going to 1.3GB after 2 Minutes (while doing nothing apart from Terminal with TOP open). Both the official (recommended) iso. Same on Ubuntu based Distros all above 1GB while Arch based are a below and OpenSUSE Tumbelweed as well but all of them not as significant as NixOS.

I agree with you that NixOS uses much less resources compared to something like Ubuntu. I didn’t specifically check the RAM usage because I have plenty of that but the lesser CPU usage is something that I noticed quite heavily on my VMs. https://www.2li.ch/blog/2022-01-17_switching_to_nixos

Guys, the NixOS VMs must simply be running less in order to be using significantly less RAM and CPU. There are no magic compiler flags that suddenly make things more efficient if you happen to know them.

1 Like

That was my thought as well.
But since I didn’t miss anything and didn’t look more into it I don’t really know what is “missing”.

Case closed. I checked on actual Hardware and it is running at around 1GB after 3 Minutes.
I knew VMs are not 100%accurate but did not know that there can be such a big discrepancy.
Sorry for the confusion and time.

And my initial Question has no solution so a closed case as well (for now).

Thanks everyone for the help - learned some things.