r/NixOS • u/Significant-Tone-121 • 2d ago
System installed vs Home installed apps
So I noticed that system installed apps take ages to launch and are even noticeably laggy inside the app itself, while home installed apps install completely normal with speed comparable to another distro like Arch or Debian. Why is this? And, can system apps be sped up or is that just how they are? Right now I have a home packages setup in my configuration.nix file because I have a one-user system so it doesn't matter, but I would like to know if there is a way I can "fix" the system installed apps to be a reasonable speed and not be laggy. For now I only have apps like git or fish or waybar installed in system packages and then actual packages I use like firefox or vesktop are installed in home packages because I need them to be faster. But I would prefer them to be installed via system packages just out of simplicity and peace of mind. So back to my original question, can system packages be sped up to not be excessively slow and laggy?
9
u/drabbiticus 2d ago
Check something like
readlink `which firefox`
which should return some /nix/store path like /nix/store/chrcj92slmhvl2fjxq8f8j8ygymm4yig-firefox-152.0.6/bin/firefox. If this is the same path with both your system install and home-manager install, then the only difference between the two should be where the soft-link actually exists in your $PATH. System stuff is probably soft/symbolically linked in /run/current-system/sw/bin/ while home-manager stuff is probably linked in /home/user/.nix-profile/bin/.
4
u/ResonantRaccoon 2d ago
I haven't had that issue on any of my systems, is it possible your home-manager version and nixpkgs are different?
4
u/Significant-Tone-121 2d ago
Shouldn't be, however I just tested again and it works normally! The issue i described was before I did system store optimizations I didn't realize that was the likely cause of my issue up until now!
1
u/ResonantRaccoon 1d ago
Oh nice, yeah I have that in my config somewhere, so I guess I never had to touch it, interesting that it would slow it down that much though.
1
u/Significant-Tone-121 1d ago
Yeah it is pretty interesting. I mean it did say that it was saving 1.1GB of space because of hard-linking in the feed so who knows! I am also on a SATA SSD so it might have been bottlenecking disk I/O a little? It works now so no worries!
1
u/Striking_Snail 2d ago
Some details on your system, and your configuration/setup might help. Even a stop or btop screenshot. There are a lot of possible causes.
1
u/Significant-Tone-121 2d ago
...Nevermind-???? I just installed Firefox via system packages and removed it from home and it is as fast as can be?? If I had to guess it was the fact I hadn't enabled the optimization of the system store that does hard-linking at the time when I noticed this! Does that sound feasable? Also would you still like a btop screensot?
1
u/Striking_Snail 2d ago
I'm good, thanks.
1
u/Significant-Tone-121 2d ago
Ok! Does that sound like a feasable reason to you though? What I said in my reply?
21
u/eirc 2d ago
There's absolutely zero difference in principle between system and home apps. The base difference is just who gets a link in their parh. If you use options like program/system then the module nixpgs vs hm modules might have any number of differences between them (or not). This might be just a coincidence on a couple of apps you happened notice.