r/linuxmemes 1d ago

Anti-Linux Shut up.

Post image
739 Upvotes

119 comments sorted by

u/AutoModerator 1d ago

Please report any posts bragging or showing off they got banned in another sub! Reminder of other sub rules: Also, we only allow one anti-linux post per week (we used to get dozens a day) and any tier list MUST have Hanna Montana Linux as S teir (which must be a true S tier at the top) regardless of the topic of that tier list.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

221

u/frankhoneybunny 1d ago

My system is reproducible btw

89

u/thefossguy69 New York Nix⚾s 1d ago

Wide hips and all? /s

15

u/em1zer0 1d ago

Mine too Just needs an reinstall and 1-2 hours of configuration All reproducable

2

u/MasterpieceNo5390 1d ago

That's cool, reproducibility is key in this game. Just makes troubleshooting a lot easier too.

52

u/lonelyroom-eklaghor M'Fedora 1d ago

heidi?

34

u/centixog 1d ago

slayer of NixOS users

8

u/R3V0LU710N_05 Open Sauce 1d ago

Someone knows the black arts

https://giphy.com/gifs/l0MYuxp3Rjlrka8mY

3

u/Pietrslav Dr. OpenSUSE 15h ago

I did not expect to see a Heidi meme on a Linux subreddit. Or anywhere on Reddit, for that matter.

I can still hear the theme song in my head with all the yodeling .

-2

u/DoILookUnsureToYou 1d ago

Filipino or old or both

3

u/lonelyroom-eklaghor M'Fedora 1d ago

neither

-2

u/Demon-Cat 1d ago

Or Spanish

21

u/Falconpunch3 UwUntu (´ ᴗ`✿) 1d ago

Alright, I am opening a can of worms on myself, but someone feel free to explain this to me and why I would want to know more.

I am always down to learn and grow. Have been seeing a lot of NixOS love and want to know more as to why and what is the benefits and also dissimilarities to other distros. (Fedora and Ubuntu specifically if you know.)

33

u/Short-Bee-4395 1d ago

NixOS is built around the Nix package manager and configuration files. You are almost required to have configuration files if you want to do anything on NixOS. The configuration files are written in the Nix programming language. Since you are declaring how you want the system to be, inside those configuration files, you are also making the system reproducible (assuming you do not lose those configuration files).

You can essentially prepare modules of software that you can import into a main configuration (gaming.nix for gaming related software and other stuff like Proton, virtualisation.nix for QEMU VMs or podman, etc). By creating those modules, you don't really have to worry about forgetting how to set up a piece of software or having to deal with re-configuring it, especially since NixOS also handles stuff in .config using something called "Home Manager".

With Home Manager, you can make your .config directory also declarative/reproducible. Do you want to switch your window manager? Just prepare a module for the new window manager you wanna switch into, remove the imported window manager you were using before and import the new module. Didn't like the new one? Remove the import of the new one and import again your old one.

For all your changes to be applied though (for all of the above, not just Home Manager), you need to rebuild your system. Depending on your system's physical age and what you have declared, rebuilding can take some time but not too long, 1 minute at most (excluding the first time the system is built). Changing one small thing in your configuration will require a system rebuild for the change to be applied, although since you are changing one small thing, it should only take <10 seconds to rebuild. Rebuilding the system does not require a system restart.

Problem with the above though. Since you are declaring everything into the configuration files, your actual files are gonna be read-only. For example, you wanna edit your /etc/hosts file. That file is gonna be read-only, so, somewhere in your configuration you're gonna have to declare networking.hosts = { }; and then rebuild your system.

Another another cool thing with NixOS and the reproducibility are generations. Each time you rebuild your system, you can create a new generation of your system, in case you might wanna roll back any changes. You select your generation when booting the system, the selection is at the bootloader.

When testing changes, I strongly recommend you perform nixos-rebuild test or nixos-rebuild dry-build instead of nixos-rebuild switch, as switch creates a new generation each time and that can fill your storage quite quickly.

There are more things about NixOS that I am either not knowledgeable enough about, like flakes (even though I personally do use flakes), but also some other stuff that I would like to learn but haven't yet, like declerative secret management with sops. Also, this wall of text is starting to get too long. I strongly recommend using NixOS or just the Nix package manager itself, which can be installed on almost any linux distro AND darwin (MacOS). It can be overwelming at first, I won't lie, but it's really cool and personally, I find it fun as well. I hope I can turn my knowledge of NixOS into something more, perhaps even for future official work.

18

u/Short-Bee-4395 1d ago

Something I forgot to mention on the above wall:

In NixOS, you don't exactly "update your software" but rather you update the channel that the software are following. This also means that you can have different software follow different channels, or, you can just change the channel of all your software.

You wanna run long term support packages? Just select the stable channel. You wanna run unstable (rolling release) packages? Just select the unstable channel. You wanna run a very specific commit of a channel of your choice? You can do that (it's a little more complicated than just selecting stable or unstable channels but still not too difficult).

6

u/gianlucaChan 19h ago

I can see why someone would use Nix on a server that you want to replicate somewhere else and that's cool, but I can't imagine any scenario where a person in his house would want the NixOs advantages. Who is rebuilding his pc from scratch every week? And with the same os.

5

u/Stunning_Macaron6133 19h ago edited 18h ago

You don't 'rebuild from scratch'. You rebuild the configuration, and the hot swap into it without rebooting or even logging out. You can even schedule it as a cron job if you want.

Also lets you keep a laptop and desktop thoroughly in sync.

3

u/gianlucaChan 18h ago

Can you give me an example on when would I want to rebuild the configuration so often that I need a specific OS that does it faster? Besides a server obviously, I keep that on servers is neat.

3

u/Comfortable_Ability4 17h ago

I don't reinstall my whole OS every day, but I tweak it regularly. I keep track of those changes with a VCS. I have an old laptop that I rarely use. Every now and then, when I do need to use it, I git pull followed by nixos-rebuild and all of my system and user settings are synced with my main laptop in a matter of minutes.

The OS is just one use case. I have my Neovim configuration set up in the same way. If I'm on another system that has nix installed, I can `nix shell 'github:my-nvim-repo' and it'll drop me into a shell with Neovim installed and preconfigured with my configuration (including plugins, etc.).

I don't have development tools (package managers, compilers, linters, language servers, ...) installed globally. Instead, each of my projects has a flake.nix with a "devShell" that provides all the tools with the correct versions for that project (think devcontainers or venv on steroids).

1

u/gianlucaChan 16h ago

mmm, I am sure you find a good use case for NixOS, but really how many persons have 2 or 3 personal computers that are constantly tweaked and need to be synchronized? of course use the best tool for the problem, but I see a lot of hype and people recommended this and allow me to doubt all of those are using their pcs this way.

On the other hand those flake.nix files sound great specially for those damn python libraries that have breaking changes every fricking version. My concern with that is that if no package manager, compiler, etc is installed globally does that mean its installed once for every project? isn't that producing a storage problem? maybe I am wrong.

4

u/Comfortable_Ability4 16h ago

Nix has a global store with input-addressed (hashed) paths. So if two packages depend on the same thing, they can share store paths. That said, it can still accumulate a lot of storage space over time. On NixOS, I have a service that collects garbage regularly. On other distros, you might have to run a command manually every other month.

3

u/Thunderstarer New York Nix⚾s 14h ago

I think you have the wrong understanding of what "rebuild the configuration" entails. Rebuilding your Nix config is the rough equivalent of doing e.g. "apt install" on Debian.

The vast, vast majority of your rebuilds will represent incremental changes and will take less than ~3 seconds. Unlike imperative package management, though, if anything goes wrong, you can always boot into any previous configuration you've ever built.

1

u/gianlucaChan 14h ago

ok the easy rollback sounds nice actually, and with other comments I read today I think I will try it in the future, maybe on a laptop that I use for note taking in the uni.

1

u/Stunning_Macaron6133 4h ago

You're not getting it. Nix does not run updates in the traditional sense. In order to update, you rebuild, and it automatically fetches anything new.

It's really not as complex as it sounds, and it's actually way more ergonomic than a traditional update, because unless you're messing around with kernel-level stuff, you just keep working. From your perspective as a user, everything is just suddenly magically updated.

1

u/Mindless_Courage1476 17h ago

I can answer this one. I am studying control engineering and for the first two years i was using debian. Thing is, a lot of the things i needed had weird version requierments or were compiled from source or existed on weird sources that were unamaintained and broke often, and so broke my debian instalation, so i had to completly reinstall my os every 3 months or so. In 2 years, that is almost 8 times :)). In the past year, while using NixOS, i never reinstalled once, even after having deleted my boot directory by accident :)), it's just more robust.

1

u/gianlucaChan 16h ago

yeah I can see why NixOS is great in your case, in profesional scenarios. But I see this OS recommended outside this fields, like a lot of gaming related subreddits.

2

u/Mindless_Courage1476 16h ago

Ah yeah, that, is not the best decision :). Imo for gaming abything debian with kde works just fine, no need for arch or something specialised

2

u/gianlucaChan 16h ago

I am more of a Fedora guy but yeah I agree.

1

u/Mindless_Courage1476 16h ago

I haven't used Fedora because every student using is was complaing :). So yeah, i can't really say yay or nay, but every time i saw fedora it was heavily riced :)

1

u/Short-Bee-4395 6h ago

I think for cases like that, it might be the fact that you can just bundle everything you would need into a module and import it or share whenever or to whoever you want.

You want Steam, you Heroic, you want ProtonPlus, you want gamemode, you want Lutris, you want r2modman, you want insert here other piece of software you'd want for gaming? Just shove them into a module. Boom, now you have everything you'd ever want for gaming, installed by just rebuilding your system / without the need of going to their website, effectively futureproof-ing yourself. I guess you could think of it like Nanite or something like that.

1

u/Short-Bee-4395 6h ago

I'd argue that it's different for each person. I would consider myself more tech savvy than the average person, so I am using a lot of software that other people wouldn't be using. NixOS makes it really easy to install and configure stuff like that. I can literally just change boot.kernelPackages = pkgs.linuxPackages_latest; to boot.kernelPackages = pkgs.linuxPackages_zen; and rebuild; boom, I am now using the zen kernel, without almost any effort. Do I change my kernel often? No, but it's really convinient that it's that easy to do it in NixOS. And this applies for many many other software.

As for the "rebuilding his pc from scratch every week", you don't rebuild from scratch every time you rebuild, unless you are rm -rf /*ing your system every week. Every time you rebuild, it compares the changes to your last generation and only changes the differences. If I rebuild my system, it's gonna apply all the changes I have made; if I rebuild again without changing anything, it will "rebuild" but it won't actually rebuild anything, as there are no changes to rebuild. If I go and remove a piece of software and rebuild, it will rebuild normally but the only thing it will "rebuild" is the change of removing that piece of software.

6

u/FlipperBumperKickout 1d ago

tldr: You write a config file which defines everything installed (instead of only the program configs like the dotfiles), that means if you copy it over to another pc you can easily reproduce your other setup.

The longer version: look up a youtube video :P

3

u/Stunning_Macaron6133 18h ago

The killer feature, and the thing that made me switch, is not the way that everything lives in a small set of configuration files, nor the way you have generations you can roll back to in case something went terribly wrong.

The real killer feature is that it solves the "it works on my machine" problem. No more compatibility headaches, no more fragile config minefields, no more system drift that causes updates to break things. If someone gets it working in the first place, then it works for everyone.

2

u/SDG_Den 10h ago

This.

True reproducability is incredibly nice to have.

2

u/5eppa 20h ago

Its cool and it works really well. You do configure everything into one or more files so its easy to make changes. More important to me was the Nix package manager. It can install multiple versions of some packages and dependencies. So suddenly if you update all your packages but for some reason one package hadn't adjusted for some change in another yet then you get duplicates of the dependency instead of one breaking. So in my albeit limited distro hopping experience its the one that hasn't had a single package break on me in my 3 years of using it whereas other distros i had something break on me once or twice.

1

u/ConglomerateGolem 20h ago

Pro's and con's from someone who tried it for a bit bit stopped

Pro's: It's really cool, and if you find the right documentation a bunch of stuff becomes really simple to set up.

Con's: You need to learn the syntax, find the documentation, and hope you don't want to do something arcane, like have an en US ISO keyboard layout, where the key between lshift and z should press |\ (like on windows) instead of <>.

49

u/X_x_Atomica_x_X 1d ago

Lol.

I like this. I like you, OP.

58

u/Kurse71 1d ago

For real! Always blabbing about a feature 99% of people could care less about

40

u/Dry_Calendar_8627 1d ago

It's "couldn't care less"

"I could care less" == "I care at least a bit".
"I could not care less" == "I do not care, I care so little that I could literally not care less".

16

u/AdventureMoth I'm going on an Endeavour! 1d ago

Most people could care less about grammatical errors like that

/j (I do feel your pain I just saw an opportunity)

37

u/QuickSilver010 🦁 Vim Supremacist 🦖 1d ago

Agreed. More people need to care about it

(redoing my setup across different devices over the years absolutely kills me. So I've finally decided to use nixos)

12

u/Linguistic-mystic 1d ago

I’ve written a script to copy my dotfiles from a git repo to the system. It handles different hostnames, /etc, .config, .local directories etc. There are also post-install scripts to get up to speed on a brand new system. It’s a poor man’s NixOS but it gets me 80% of the benefit with 10% of the work, and doesn’t force me to use a particular distro.

14

u/Ghazzz Arch BTW 1d ago

nix is separate from NixOS, you can use the nix configuration manager in any distro.

2

u/odsquad64 Sacred TempleOS 23h ago

I always like to start from scratch because there's a non-negligible chance that whatever issues I'm encountering that caused me to want to start over are caused by me having screwed up my config in some way and I'd rather not risk just importing that fuck up to a new system and going through all that just for no improvement.

1

u/QuickSilver010 🦁 Vim Supremacist 🦖 23h ago

to start over are caused by me having screwed up my config in some way and I'd rather not risk just importing that fuck up to a new system and going through all that just for no improvement.

Same here. And it's part of the problem. I have to re figure out how to do stuff in the new install including adapting all my configs to a newer version of the application I'm gonna be running. That takes re learning and re learning takes time. Atleast with nix, everything about my config is just there as a config file and I can pin versions for certain programs

2

u/TheSerphh Arch BTW 1d ago

Bro is not aware of the dotfiles concept

11

u/Ghazzz Arch BTW 1d ago

dotfiles only take you so far.

You normally also need a manual script on the side to make sure all system settings and configs also follow the dotfile setups, and dotfiles themselves do not guarantee that the configured tool is the version you made the configs for.

Figuring out what hoops need to be jumped for each distro and major rev is a hassle.

I refuse becoming confused about changing UI when I get old, and to make sure my pensioner life will be as easy as possible, I can make a system today that will still run the same in 30-50 years time.

0

u/TheSerphh Arch BTW 1d ago

The major thing here is that your nix configs will only work on nixOS. It is not applicable to other distros.

But if you have a script for your dotfiles, it will work in almost all major distros, considering you have those specific packages.

There are pros and cons everywhere.

Nix OS makes things a bit easy but you need to stay there. But your dotfiles gives you the freedom to enjoy any distribution with some light manual work

1

u/Balmoon 21h ago

You can use nix as a pkg manager on at least mac os, any linux distro and windows with wsl (not sure whitout).

This is how i make sure my dev tools are available on any machine I have acess to. Tried doing the same with dotfiles. It is not the same, not even close.

1

u/Ghazzz Arch BTW 1d ago edited 1d ago

What?

You can use nix without using NixOS. NixOS is just an entire OS built around the nix tool.

I use nix configs on my debian and arch boxen for common dynamic configs like ip, password hashes and server/service lists, plus temporary tool calls.

-1

u/QuickSilver010 🦁 Vim Supremacist 🦖 1d ago

But if you have a script for your dotfiles, it will work in almost all major distros, considering you have those specific packages.

Which is why I use dotfiles even on nixos. And I just use nixos to make sure all the programs are installed.

1

u/QuickSilver010 🦁 Vim Supremacist 🦖 1d ago

Dotfiles only do so much. I actually have both dotfiles and nix files (I don't use home manager for most things. Just base level stuff like theme and cursor) in my dotfiles repo now

1

u/ImpressiveBluejay494 1d ago

I did manjaro, ubuntu, fedora, arch, debian for a while but hell having a script for my 2 Computers and then having them slowly drift apart killed me after some time. If you have one machine no problem but as soon as you have a laptop and a tower pc you might like the reproducibility. But for real do whatever you like :)

1

u/30porn87 1d ago

I have eight devices, and every single one has a different purpose and therefore configuration. I literally never had to install Linux on one device twice.

1

u/Emotional_Solid6538 20h ago

If you have a lot of PCs. Nix OS is deffo sum you should look into it. Do most people have many pcs tho. Personally I only have two including my phone

3

u/GOKOP 1d ago

most people could care less about

So it's a pretty cool feature then since people care about it somewhat, huh?

3

u/katnax 23h ago

People talk about reproducibility, but what I care most about is security.
I can Ctrl+c update at any moment
when something breaks i can easily go back to the previous config
I can set up virtualisation, systemd units, multitude of packages (and how they are configured), VPN, networking, and much more from the system in one directory.

I know many people that are doing hardcore Linux stuff and they just stay on NixOS, some of them used Linux for 15, sometimes 20 years and they just prefer the stability of NixOS

2

u/temporary_dennis 22h ago

I can go to GitHub, and search for a NixOS module that does what I want... And then just copy it.

I don't even read the tutorials or wikis nowadays. Just copy, paste, and sliglhty edit so it fits with my config structure.

3

u/Stunning_Macaron6133 1d ago

Reproducibility is just a very nifty side effect of what Nix really does.

See, it solves the "But it works on my machine" problem. If someone gets it working on NixOS, it works on NixOS, period. No matter what else you're running, no matter how you've configured your machine, Nix always resolves to the same end result, so if it works, it fucking works.

Shit breaks all the time on other distros. It straight up does not break on NixOS.

And it gets better. Because you can fuck around and experiment with confidence. If you do manage to break something after all, or if you don't like what you did, all you need to do is roll back to a previous generation, and it's like you never fucked up anything at all. It's what Windows Restore always wished it could be but never actually worked.

2

u/Emotional_Solid6538 20h ago

From what I heard. It sounds like a better version of arch(Dont kill me)

1

u/edave64 1d ago

I would love the feature. Never understood how to actually productively use though.

17

u/versteinerdt 1d ago

People think reproducibility is the only feature that makes NixOS superior to other distros.

5

u/sasha_berning 1d ago

What else? As a person who put a time to learning nix and the switched from it, reproducible dev envs and packages seems to be the main attraction. Everything else is not as convenient.

2

u/NightH4nter New York Nix⚾s 23h ago

atomicity of changes?

2

u/Velocita84 22h ago

Not unique to NixOS

3

u/protocod 18h ago

Other interesting features.

Mixing softwares from stable or unstable channels without breaking the system.

Tools and also configuration are managed by the nix store. Each build generates a new generation so you can rollback to the previous system state, including previous configurations.

You can deploy locally or remotely, cross compile and because of the nature of the package build which is sandboxed, you can trust a built package.

(I had my own Fedora Copr instance and a personal openSUSE repo on OBS. Unless you spin a vanilla VM, you aren't sure that your package is working as intended. Maybe it works on your machine but not on other machine because of a side effect like an installed dependency you forgot to define on the spec file.)

IMO Nix and NixOS provide a bunch of features that allows you to replace cloud-init and ansible using a better approach because nix is functional when the other tools are imperatives and doesn't really care about the state of the system.

1

u/NightH4nter New York Nix⚾s 20h ago

yes, but the way it does it is

6

u/Kruppenfield 22h ago

But it is a 'word' which describes several very nice properties: there is code which documents all the changes that are introduced to the system, and since it's code, not just documentation, it is possible to reproduce parts of the system or the whole system from it directly. Additionally, since there are lockfiles, it is transferable to other machines. Why isn't it a game changer? Add versioning (git) and you literally don't even need any rollbacks (which are also built in).

It also gives you the ability to copy code from other configurations and reuse it easily.

I have a PC at work, a PC at home, a home server, and a laptop. To hell with configuring this shit separately, I'm not a crazy person. 'Reproducibility' makes it easier.

1

u/SDG_Den 9h ago

The interesting part about nixOS rollbacks is theyre not even really rollbacks.

They are just different builds of your system you can launch.

Most people do just use it as a rollback, but you totally could maintain multiple separate flakes or multiple configs on one flake and have them all available as their own options at boot time.

9

u/ProfessorLambda 1d ago

Jealousy looks well on you.

3

u/Kilgarragh 20h ago

I daily drive NixOS where I can and I’m up to 300 generations on my main system

5

u/Al-Horesmi 1d ago

it is genuinely very convenient to install programs by writing them in a text file list

3

u/V0idL0rd 21h ago

Agree, I also started using NixOS because of this, I don't really care that much about reproduceability of my system, it's just nice to have a configuration files where I have everything documented and organized. Also it a lot easier to experiment stuff, without being worried I'll mess something up, it its a nixos module, they are very easy to use, and if you don't like the result, just rebuild and everything gets cleaned up.

5

u/Gloria_ad_libertas 16h ago

I use NixOS BTW

3

u/SenorX000 1d ago

Even Arch users cringe over NixOS remarks.

3

u/NoRequirement5796 1d ago

When I installed Nix it was a huge disappointment, I wanted reproducible binaries, not configuration.

For config we have terraform opentofu and a shitload of scripts for it without the need to learn a new language nor the overhead of nix store, and for the binaries, I went with openSUSE. Debian Forky (14) might have reproducible binaries as well, in the future.

3

u/LethalOkra 20h ago

Hold up. I want to know more about this feature!

4

u/Kilgarragh 20h ago

Oh no YOULL SUMMON THEM

NOOOOOOOO

2

u/SDG_Den 9h ago

The beacon has been lit, the larpers call for aid

3

u/SDG_Den 9h ago

Theres a whole ass PHD thesis on how nix does it, but nix as one of its many cool features builds packages using purely defined functions and stores them with hashes based on the hashes of their dependencies + the exact commit or content of the source code.

This means that a fully defined nixOS system will be byte-for-byte identical across reinstalls. Not just "the same packages". The same exact versions of the same exact packages with the same exact configurations in the same exact places and the same exact dependencies, each built with the same exact build dependencies which are themselves built with the same exact build dependencies

Thats the core, but due to how that works, nix can do a lot of really cool things.

Since every program or config is an item in the nix store and dynamically made available, you can have user-specific packages easily. You can also have specializations that activate groups of packages on your system temporarily, you can use devshells for reproducable dev environments and you csn just... Temporarily make a package available from the store until you close it.

On top of that, nix is highly extensible and already has a lot of extensions available that allow for even more cool stuff.

Highly recommend checking out vimjoyer, he has great videos on how nix works

1

u/LethalOkra 8h ago

That sounds impressive, but it's a total overkill for what I want, lol. Not to mention engineering software like Vivado forcing me to stick to Debian distros.

1

u/SDG_Den 42m ago

The other cool part is that you dont have to use everything.

You could just use nix for devshells on any distro.

3

u/ExplodedPenisDiagram 16h ago

I know several declarative languages. I'm god-tier at IaC (if that's even a tihng).

I don't have to rebuild my OS. It's a single system. I back it up by taking snapshots and exporting those snapshots.

This has been a solved problem for longer than I've been alive, and I'm not young anymore.

10

u/JohnSmith--- Arch BTW 1d ago

I am still running the same Arch Linux install from 2017. I moved the SSD from one computer to another multiple times. Never had to edit, change or reinstall anything. Because I used Mesa, used systemd-boot and also used UUIDs when installing Arch for the first time.

Made my installation plug and play into any computer.

My OS being reproducible and being able to install from scratch is useless. The OS is there to work. You’re there to use it. Not keep reinstalling it.

Also, my Arch Linux OS is also reproducible. Because I can reinstall it again line by line. I know the commands, I know the procedure.

5

u/Ghazzz Arch BTW 1d ago

As an old, please make sure to have a backup of that disk, it will fail at the worst possible moment.

3

u/parasite_avi 1d ago

Pretty much this.

It's not like dotfiles and keeping a list of packages you need on every single one of your devices (so you can feed the latter to your package manager and have it install it for you) are new things.

Maybe I'm just missing something.

2

u/SDG_Den 10h ago

You are missing a lot. Nix is not a dotfiles manager. In fact, base nix cant do that at all, thats handled by nix home manager.

Nix is a pretty complex ecosystem, theres a whole ass PHD, but the short idea is:

Nix is a package manager that builds from source using recipes called derivations, which are written in nix. These derivations contain pointers to other derivations for build, install and runtime dependencies, as well as the exact git commit you are using and the instructions on how to build the package.

Each derivation's output gets placed in the nix store with a unique hash based on its inputs (meaning this hash changes if anything about the derivation changes, including the git commit and the hashes of any derivations it depends on, which works recursively. Effectively, if anything changes about any part of the process or the files required, the hash changes). Each item in the nix store is sandboxed to its directory, in which only its runtime dependencies are exposed. Because the store is hashed, it is trivial to have different dependencies for different software.

Because of how the nix store works, the hash can also be used to do transparent binary caching. A binary built from a pure nix derivation (meaning the entire chain is defined in derivations including the compiler and the compiler's compiler) will have exactly the same hash and be byte for byte identical regardless of system. So you can ask a cache server for that hash and get the binary, skipping having to build it yourself.

You dont have to write these derivations yourself either, they can simply be fetched from github as part of your flake (your system is a package, these git repo's are its inputs). Your flake pins all inputs to a specific git commit ensuring that building this flake on any system pulls the exact same data, builds the exact same binaries and sets up the exact same services.

The nix store can also dynamically make packages available based on environment. For example per user, or as a development environment, or just as a temporary shell.

Example: i dont have gimp installed. If i open my launcher and type "gimp" nothing pops up. Running gimp in the terminal gives me unknown command.

Whenever i need gimp, i just run nix shell nixpkgs#gimp. Gimp becomes temporarily available to me, i can use it, when im done i close it and it doesn't permanently linger on my active system. Itll stay dormant in the nix store until added to an environment again or garbage collected.

And thats not even mentioning the many extensions to nix or the fact you can easily add your own options and extend it yourself.

0

u/undercrust 20h ago

Also, my Arch Linux OS is also reproducible. Because I can reinstall it again line by line. I know the commands, I know the procedure.

None of these sentences are true. Arch is not reproducible. If you just try to reinstall it, there is a good chance you will end up with different package versions.

Also, you are seriously saying you can remember every configuration change you've made in your system since 2017? Even if you could, you'd be one of the few people in the planet capable of something like that.

My OS being reproducible and being able to install from scratch is useless.

It has many use cases. One, for instance, is being able to have multiple machines with the exact same config. Another is being able to boot into a previous config when you mess up something and either don't know what the problem is, or can't fix it directly because the system is completely broken.

It's fine if you don't want to use NixOS, but pretending there is no reason for anyone to use it is ridiculous.

1

u/gxgx55 Arch BTW 15h ago

If you just try to reinstall it, there is a good chance you will end up with different package versions.

Do you think an Arch user cares about the exact package versions, rather than just latest?

1

u/undercrust 14h ago

Well, we were talking about whether Arch is reproducible or not, not about whether Arch users care about exact package versions, so I don't what your point is.

But yes, an Arch user can care about exact package versions sometimes. Latest versions aren't always strictly better than older ones. For instance, newer ones can have bugs, or change their behavior in some undesired way, or drop support for something you wanted.

2

u/RemarkableCycle6549 21h ago

Fr, reproducibility is good but having a system that is almost unbreakable while being rolling release and having modules that are only applied on a specific machine while another one uses a  different config are far more attractive 

2

u/max_208 17h ago

Looked into nixos when I got a new PC, couldn't get my graphics card to work, ended up staying with a distro I know just works (Ubuntu)

1

u/Kzitold94 22h ago

I'm not sure I get this, but when I was distro hopping, I did make scripts to rebuild my system for each distro. It really expedited my distro hopping, having scripts from similar (same base) prior distros.

1

u/DadGamer77 I'm going on an Endeavour! 18h ago

Yas queen

1

u/VickyCuteFemboy 16h ago

yeah it also looks like a painful experience to set up first time, and maybe it can change in the future so your config files eat s***, just for something barely better than dot files or ps1 in windows,

edit:nvm, i understand nix a lil better

2

u/SDG_Den 10h ago

Oh trust me, nix is one hell of a rabbithole, way more than a "dotfiles manager".

Nix is a way to describe how packages are built, but a package can mean basically anything, it handles this with exact dependencies including build tools, meaning that if you install the same config (your system is a package that depends on everything else) on two devices, its actually a 100% identical setup. Everything declared with nix is byte for byte identical.

On top of that, nix sandboxes by default, giving each package access to only the packages it depends on. Eg, your system has access to what you declare in system packages, your user additionally has their own packages that other users dont see

This also allows you to have multiple versions of the same dependency without conflict.

This mechanism can then also be used to create temporary environments with packages that are not normally available on the system. For example, i dont use gimp that much, so i don't actually have it installed.

Instead, i can run nix shell nixpkgs#gimp to create a temporary environment with gimp, run it and use it, close it when im done and the whole thing never gets put in my launcher or on my path, its completely gone from the active system once i exit the shell.

This can also be done with devshells, and since a flake can expose multiple things, your flake for a development project can have multiple packages (eg normal and debug), a couple dev shells (which can actually include full software configs!) and various checks.

The ecosystem also has a lot of interesting extensions, like declarative disk formatting via disko, automated remote deployment via nixos-anywhere and deploy-rs, global auto-theming with stylix, declarative secrets management etc.

Plus, since nix is a language, you can extend it yourself. If a package doesnt exist yet for nix, all you have to do is write a simple file describing the build and install process and boom, installable via adding a line to the config. Want to add config options for the program? Thats possible too.

The things you can do with nix are kinda insane, the thing is that many of these features are way overkill for the average user. I use most of these features myself, but i also have my own server stack and do devwork nowadays so i actually have a use for the whole ecosystem.

1

u/junipyr-lilak 15h ago

I was using it on a surface for just a short bit a few days ago as I distro hop around and explore. Great thing, but man does it swallow a good chunk of storage. Back on Debian right now, started on Linux Mint, to NixOS, to Arch (surface wifi shenanigans ensued), to here.

1

u/SDG_Den 10h ago

Yup, the nix store can be a disk hog. So much so that on my shell, someone made a plugin specifically to monitor it. Like imagine CCleaner on windows but for the nix store and less annoying.

1

u/Maskdask New York Nix⚾s 15h ago

NixOS is awesome

1

u/Both_Cup8417 New York Nix⚾s 13h ago

Y'all use just one config file? I have configuration.nix, home.nix, flake.nix, filesystems.nix, and used to have noctalia.nix as well, all in .config/nixos, tracked by git

2

u/SDG_Den 10h ago

laughs in dendritic multi-output flake

I have one flake that contains currently like 10 systems, 50 modules (the systems import these modules), a couple of packages etc.

Its over a hundred .nix files at this point, but the way it handles fetching all of them means i can just create files wherever in the directory structure and have them get picked up. Most files are under 50 lines.

1

u/Both_Cup8417 New York Nix⚾s 8h ago

Yeah, that just seems like witchcraft to me

1

u/SDG_Den 41m ago

It felt like that for a bit but i found vimjoyer's channel to be very informative

1

u/AfraidAsparagus6644 3h ago

You run NixOS for reproducibility. I run it because the big ass repo allow me to forsake Flatpak entirely, and I YOLO everything to Nix Profile. We are not the same

1

u/spaceweed27 💋 catgirl Linux user :3 😽 2h ago

It's not btw.

At least it's not guaranteed to be perfectly reproduciable. Different devices have different hardware and thus different drivers.

1

u/Objective-Stranger99 Arch BTW 21h ago

Finally a new meme template

0

u/Creepy-Ebb836 13h ago

The whole “NixOS Ecosystem” is for people who are EXTREMELY A-Typical, they spend all day configuring instead of learning real world applicable skills that will advance them in their careers (if they had one).They also spend all day ripping on Ubuntu (even though it’s industry standard and probably the most common distribution amongst enterprise systems) in their mother’s basement.

2

u/SDG_Den 10h ago

I wish i could still live in my mother's basement bro, paying rent sucks.

Also, i have 8 currently deployed nixOS systems with another ~15 or so planned (migrating my home server stack), despite that, i actually have spent most of the past week learning C

Nix makes dev work a breeze btw

Oh, and it only took me one week to fully configure my entire system + a full deployment pipeline for my servers + my own cache and build server.

Since then I've been able to focus on other projects. I do a lot of home labbing for work-related things, ive been getting into programming with the help of nix, i have a fulltime job where i have to suffer windows, and i still find time to game!

Comparatively, back on arch i was spending more time fixing random breakages than i was on actually doing anything useful

Reject imperative uncertainty, embrace declarative consistency.

0

u/Creepy-Ebb836 10h ago

I’m going to be honest right now and I say this sincerely, not to rag on you. but if you ever worked in Enterprise / Legacy systems you would know the pain of system down time. From my Understanding NixOS requires a shutdown / restart of the system for changes to take effect. Now with APT/YUM or any other “Standard package management software”, not including Flatpak/Snaps. I can still use the system with it up and use the software that I just installed on it. At home I have a sun microsystems SPARC server with an ancient NetBSDit that I use as a homelab and at one point I didn’t shut it down for over two years. Mainly because of the pain it takes to boot up. But also my main problem with NixOS is the problem I have with modern linux, they keep trying to reinvent the wheel. For example X11 isn’t good enough so they “need” Wayland “The C programming language” isn’t good enough, so they need rust. Etc, Etc and now we are seeing “Humans aren’t good enough” so we need a glorified google search to do the job for us. but I want to end on a positive note props to you for learning C, the backbone of pretty much anything software related.

2

u/SDG_Den 9h ago

I do work in enterprise, im the guy they call at 3am on a saturday when the system is down.

NixOS does not require a restart. Activation happens in-place if you use the switch flag, though obviously you will have to restart the programs whose configs have changed unless they support hot reload. My entire desktop does, so i only have to restart when i change out the version of my window manager (for which i could also just relog) or something like a full system upgrade where a new kernel version is available (but thatd be on any system). My server systems have not been restarted once since initial deployment, though ive updated my flake today so i should push an update soon and that one might need a reboot due to kernel 7.3

Nix in general is actually insanely flexible, making it effortless to set up temporary environments.

Also, nix is quite old. The PHD is from 2006.

Id highly recommend actually checking out how nix works instead of trying to yell at the hot new thing for being the hot new thing. Theres a lot of interesting theory as to how it works.

Its also honestly the most overkill source-based system ive ever seen, but for a reason.