this post was submitted on 05 Aug 2023
174 points (98.3% liked)

Linux

48143 readers
770 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I'm currently running Arch and it's great, but I'm noticing I'm not staying on the ball in regards to updates. I've been reading a bit about Nix and NixOS and thinking of trying it as my daily driver. I've got a Lenovo x1 xtreme laptop, I don't do much gaming (except OSRS), use firefox, jetbrains stuff, bitwarden, remmina, obsidian, and docker.

Is anyone running NixOS as their daily? How are you liking it and are there any pitfalls / stuff you wish you knew before?

top 50 comments
sorted by: hot top controversial new old
[–] elltee@lemmy.one 47 points 1 year ago (3 children)

Been daily for a while now, came over from Garuda, and a few other Arch derivative before that. NixOS is 99.9% fantastic. Lenovo carbon X1 Gen 6. Runs great. Newer custom build higher end desktop with AMD 7900RX GPU. Also runs great. I have a feeling it'll run great on pretty much anything.

The package store is amazing. The package store absolutely dwarfs the AUR. That being said, it seems a lot of the store packages are support / dependency packages that you wouldn't install standalone.
I always had a concern in the back of my mind with the AUR. Is the package trusted by multiple people?
I've not had to rollback much, but it's SUPER simple, and takes seconds for the most part. A reboot at the most.

Things I wish I knew: I run declarative for everything, rather than imperative. Therefore, small changes are a tiny bit more of a hassle. Example: changing the hosts file. Rather than a quick hosts file edit and done, it's a quick edit of the system configuration file, then a nixos-rebuild switch. Nearly any change is like this. (I've not moved to flakes yet.)

if you have any shell scripts, and they're hard-coded to the env: #!/bin/bash, #!/usr/bin/zsh, etc.. you'll need to port those over to #!/usr/bin/env

appimages are well supported, but I ran into an issue where a custom appimage that someone else wrote won't authenticate correctly because the browser isn't included in the environment. I could t-shoot it more, but just too damn lazy to care.

The local storage location for apps can get huge rather quickly, as each iteration/change is stored for rollback purposes. Make sure to setup a garbage collection schedule with whatever your comfortable with.

Would i recommend? Depends on your patience and prior experience. NixOs is VERY VERY different than arch or pretty much any other distro, even other immutable ones. It takes a bit to get your head wrapped around it.

I saw someone say start with Nix (the package manager) on your current distro, learn the ropes, add in pieces like Flakes and Home Manager as you learn. Learn the Nix language. And then move to NixOS. Probably good advice.

I ignored all of that. Jumped in head first. Lots of frustration in the beginning. But now... I won't be going back to a standard linux distro.

Immutability makes me warm and fuzzy. Being absolutely sure that I can easily recover from a boneheaded mistake. Beautiful. Hard drive shits the bed? Drop in a new one, apply my configs, and I'm right back where I was within 30 minutes, complete with all data, apps installed and configured? Priceless.

[–] dinckelman@lemmy.world 12 points 1 year ago (1 children)

I attempted to use Nix as a daily driver recently, and while it ran great, and I loved the idea of what it's doing, I got absolutely destroyed by the config. Since we're in transition to nix-command right now, a lot of documentation is really confusing, and on top of that, home-manager was not as intuitive ad it sounds. I'll probably be giving it another shot later, but for now the time investment doesn't seem to be immediately worth it for my work flow

[–] elltee@lemmy.one 3 points 1 year ago

This is similar to my story. I installed it on a laptop. Got really frustrated with it, and went back to arco for a while. Took the full plunge a couple months later, and decided I'm just gonna do it, torpedoes be damned. no regrets now.

[–] schizosfera@feddit.de 12 points 1 year ago (1 children)

You made me very curious about NixOS and now I'll have to take a closer look at it. The second to last sentence did it. Thanks

[–] elltee@lemmy.one 6 points 1 year ago

Awesome. Welcome to the club. Be patient. It's VERY different. The more you learn Nix (the language) the better off you'll be. I'm still on that path myself.

[–] Linuturk@lemmy.onitato.com 8 points 1 year ago (1 children)

I can understand how the system config can be back in that short amount of time. How does data backup and restore work in Nix? Is it different than other distros?

[–] elltee@lemmy.one 9 points 1 year ago (2 children)

Data wise, it's mostly the same. i use syncthing to a couple different systems, one of which is essentially a storage server. The main difference for me is the app installations. apt install all the apps, then configure each. Kills a whole day for me. I'm sure it can be automated, maybe ansible / salt / . But the way I use it, Nix enforces that I always update my configs in a manner that is easily restorable.
Copy my backed up system into /etc/nixos/
Run nixos-rebuild boot. Reboot.
Setup syncthing. ? Profit

load more comments (2 replies)
[–] K900@lemmy.0upti.me 36 points 1 year ago (5 children)

User/maintainer here. I don't think NixOS is for everyone, but if you're the kind of person it's for, you'll be stuck with us forever. I would definitely recommend giving it a shot if the concept sounds appealing, and feel free to drop by the Matrix channels if you need any help figuring things out - documentation is currently not our strong suit, though people are working on it.

[–] Atemu@lemmy.ml 6 points 1 year ago (1 children)

Ayyy nice to see you've moved over too.

[–] K900@lemmy.0upti.me 4 points 1 year ago

I'm surprised you haven't noticed me screaming about Lemmy in #offtopic for like three days straight lol

load more comments (4 replies)
[–] lloram239@feddit.de 31 points 1 year ago* (last edited 1 year ago)

First up, forget about install NixOS as a full distribution for the moment, instead just install the Nix packagemanager on your current system. That gives you like a quick&easy way to enjoy most of the benefits of NixOS without replacing what you already have up&running.

As for things to note:

  • nix-command and flakes are the new way of doing things, but still not enabled by default, this can make some old documentation a bit confusing, as this update completely changes the CLI interface, just enable them and ignore everything that keeps taking about the old `nix-env"

  • you'll be downloading a lot, NixOS has no binary compatibility for libraries, meaning, if a library changes, everything that depended on it changes as well, this can cause seemingly trivial updates to balloon into 30GB downloads

  • expect your installation to be bigger than usual, as upgrades will keep all the old software around, i.e. you can just boot into the previous version with a single click until you nix-collect-garbage -d all the old stuff, on systems with 32GB flash you have to be a bit careful to not run out of storage

  • no LTS releases, you'll have to update every six months

  • almost no compatibility to third party software by default, /bin/sh and /usr/bin/env are the only thing it has in common with the normal FHS file system layout that everybody else is using, so expect every install.sh to fail, there are of course ways around it (e.g. buildFHSEnv), but they require some extra effort

  • all system configuration happens in /etc/nixos/, the rest of /etc is just read-only symlinks

  • .nix configuration file syntax is a lazy evaluated functional language, that looks somewhat similar to JSON, it's quite a simple language, but not one that you can easily figure out just by looking at it (e.g. ":" defines a function, functions can only have one argument, everything else is done with currying), read the manual

  • https://search.nixos.org/options will be your best friend and nix repl followed by :l to tab-complete your way through the Nix structure

Overall I am very happy with NixOS. Switching to NixOS was the first time in a decade that Linux started to be fun again. It comes with an enormous package collection. Building your own packages is trivial. It is possible to upgrade, downgrade or just run multiple versions in parallel, so no forced-upgrades as on other distributions. Also the Nix package manager can work as first-class build system, meaning git repositories can be treated as full packages (assuming they contain a flake.nix), packages by the distribution no longer have to exist as this weird appendage that has to exist independently from Upstream.

[–] siph@lemmy.ml 21 points 1 year ago (1 children)

I've been using NixOS for over a year and I can't imagine using anything else. I originally started using it because I liked the idea of version controlling the entire configuration, but now I use it for everything.

The most underrated feature of Nix is being able to instantly roll back an update that breaks something that you don't want to deal with. An update breaks kitty or neovim? If I have something to do I can just roll back and fix it later. Awesome.

It's not for everyone. I can't imagine someone who isn't at least a hobbyist programmer having the desire to overcome the technical nature of it.

Heres my config.

[–] Omniformative@lemm.ee 7 points 1 year ago (1 children)

btrfs + snapper can easily achieve the same thing. You can checkout OpenSUSE.

[–] siph@lemmy.ml 5 points 1 year ago

Yeah, btrfs is awesome and it's easy to use with NixOS as well. The rollback mechanics are different in that Nix isn't actually rolling back it's just rebuilding a previous revision (commit) of the config.

[–] pimeys@lemmy.nauk.io 21 points 1 year ago* (last edited 1 year ago) (2 children)

I've been running NixOS for the past four years in all my computers. It's really, really the end game of Linux distributions for me. But it's not for everybody. The Nix language can be a tough thing to learn, if you're not a programmer and haven't done anything with lazy functional languages before. It's a dynamic language, with not super great documentation for practical things and missing a good language server that would let you to jump to definitions when learning how nixpkgs work and how to build things.

Also, what I think is a serious problem, is how flakes are not yet enabled in the default installation. So first you learn with the basic template, and some helpful person comes talking about how great flakes are, and in a few weeks you might have written your own system flake finally and got it working. Flakes are really important to understand as soon as possible, because with them you get the lock file that gives you real reproducibility between computers and full control on which version of packages you get.

But, when you learn all that, and get your company to go full-on with nix, having flakes in all projects, it's the best programmer's operating system out there. Here's my config to steal stuff.

[–] midas@ymmel.nl 5 points 1 year ago

Thanks for the config! I'm a developer and that also contributes to my interest - being able to express my configuration like that. Your config is a bit overwhelming, but in a good way, I've created a git repo for myself to start off and using yours as a reference since you seem to do a lot of cool shit. Am going to start off with flakes.

Not sure if I'm going to jump in with both feet yet (since apart from my work laptop and servers, this is my only machine) but I am going to journey into writing a conifguration properly and testing it on a VM. Already using nix packages on my Arch install.

load more comments (1 replies)
[–] monk@lemmy.unboiled.info 20 points 1 year ago (2 children)

Of course. There's just one pitfall: there's no turning back, once you grasp it, the inferior ways of the past become unbearable.

[–] nothendev@sopuli.xyz 2 points 1 year ago

The hard truth...

load more comments (1 replies)
[–] nothendev@sopuli.xyz 18 points 1 year ago (1 children)

Yes. Absolutely.

For me it shines in the replicability. For example recently (at the time of writing this) I have gone to a different place without the ability to take my pc with me (its not a laptop duh). I prepared my config and pushed it to the git repo. With me I only brought a usb drive with all my ssh keys and another one with the headless NixOS installation environment. I set it up, had to do some UEFI smashing and hardware adjusting but that's just hardware specific. In like 30 minutes I had my full setup, my hyprland, my doom emacs, and most of that time it was downloading packages.(not to say cache.nixos.org is slow but the internet there was dogsh...)

Would I recommend? If you are ready to do some table smashing and if you are experienced enough with Linux and the nitty gritty of it, then HECK YEAH. You have to know that NixOS is not for beginners. It is a bulletproof distro for ultra power users that, if you use correctly could lead to a impenetrably stable system, which you could reproduce on ANY other machine. And also rollbacks are awesome.

Conclusion? NixOS is awesome!

load more comments (1 replies)
[–] Decker108@lemmy.ml 18 points 1 year ago (1 children)

I had a colleague who ran NixOS on his work laptop and loved it. He even held a presentation to the rest of the engineering dept about it. Then IT contacted him and said company policy only allowed running Ubuntu and he had to reinstall.

He resigned shortly after.

[–] yum13241@lemm.ee 7 points 1 year ago (2 children)

Cuz fuck Ubuntu and fuck corporate policies about what OS I need to use.

load more comments (2 replies)
[–] Tilted@programming.dev 13 points 1 year ago (1 children)

I have used it as a daily driver. My biggest issue was the nix language. If I was to go back, I would invest more time in learning nix.

[–] flashgnash@lemm.ee 2 points 1 year ago

Personally I still don't have a great idea of how the language works, kinda just took the template and extended it following the same pattern, if it gave me a syntax error trying to do something funky I fix it and learn through trial and error

[–] Ultra980@lemmy.world 12 points 1 year ago (1 children)

I'm using NixOS, and I have a few tips:

  1. Use flakes
  2. If it ain't working, steam-run it.
[–] flashgnash@lemm.ee 2 points 1 year ago (1 children)

Daily driving it myself but have yet to really use flakes. What's the benefit of them?

[–] Ultra980@lemmy.world 3 points 1 year ago (6 children)

They're more reproducible, they make dependency management easier, the commands you use with them are easier to use and more readable, and it's easier to have multiple packages/systems/home-manager profiles in a single git repo. They also make version management easier

load more comments (6 replies)
[–] quentangle@lemmy.world 12 points 1 year ago (5 children)

Another daily driver user here (for about a year now). NixOS on all hardware that can run it (desktop, servers). Nix-darwin/home-manager/nix-on-droid everywhere else.

I don't see myself going back to anything else, it's great.

load more comments (5 replies)
[–] featherfurl@lemmy.ml 8 points 1 year ago

NixOS is absolutely worth the effort. You have to frontload a bit of effort setting up configs, but you get a whole lot of incredibly valuable stuff in return, and a lot of things become easier in the long run.

[–] axelf@lemmy.ml 8 points 1 year ago (3 children)

I have been a very happy NixOS user for 2 1/2 years now! (https://github.com/axelf4/nixos-config)

load more comments (3 replies)
[–] thejevans@lemmy.ml 7 points 1 year ago

I'm using it currently. Documentation is really annoying to deal with because it's changing so quickly. I went with a flake + home manager setup and tried to keep my config as spartan as possible. Most of the configurations I found online use a ton of files an a deep tree of folders and I found that really hard to follow. You can look at my configuration here.

[–] swansea@lemmy.world 7 points 1 year ago

It’s a lot of work tbh. I’ve used arch for 10+ years and recently switched to NixOs to give it a spin, and couldn’t get my exact setup that I wanted for tools and accessories I use, and the system immutability isn’t that practical imo. So I switched back to my old Arch setup and now just use Flakes for various projects I have, basically just the Nix part, which is very nice imo.

[–] snek_boi@lemmy.ml 7 points 1 year ago* (last edited 1 year ago)

I've been daily driving it for six months now. I wish I would've know the Nix language well enough before jumping in to attempt declarative configurations. Not that it's hard.

I have had issues that have had me temporarily try Pop or Debian, but dependency hell is real and the Nix community is wonderful. I have been able to solve every single one of my handful of problems in less than a day or two (sometimes in minutes) with the community.

Edit: oh yeah, and documentation is not great... Again, the community has been my source of answers to many questions.

As many others have said, it's hard to imagine life without NixOS once you get the hang of it.

[–] acow@beehaw.org 7 points 1 year ago

Daily use for several years. Nix the package manager has been the bigger impact for me as I use multiple systems, and they’re not all running NixOS, but my nix configs work across them all. As for NixOS, I would not necessarily recommend it for a non-programmer, but if you’ve ever found yourself thinking about how operating systems are assembled from parts, then NixOS could be a very good fit for you.

[–] haroldstork@lemm.ee 6 points 1 year ago (2 children)

I love NixOS. I run it on my home server. However, I can’t daily drive it. I need something a little less rigid to do my day to day work. Although it is greatly satisfying to have everything reproducible, it isn’t always practical to dedicate the time to making it so.

load more comments (2 replies)
[–] bumble@beevibes.net 5 points 1 year ago

I really like it. The language took me time to learn but so far it has been worth it. The ability to rollback in git and rebuild has saved my computer countless times; usually from my own mistakes.

[–] tom42@lemmy.world 5 points 1 year ago

Using NixOS as my daily OS on a X1 since six years now.

The first months have been hard as at this time was no installer at all and I had to do everything manually. After a while I got used to the update process.

Recently I switched to Nix Flakes which is another challenge but seems to make the Nix way even more consequent.

The only odd thing what drives me nerves is that compiling on that machine takes sometimes a half day.

Besides this it is still the best OS I ever used

[–] rikudou@lemmings.world 4 points 1 year ago

I had as a daily driver for a few weeks through VirtualBox. Next week I plan on installing it as a secondary OS to see if it plays well with my hardware and if so, I'll make it my only OS.

[–] BCsven@lemmy.ca 4 points 1 year ago (1 children)

My wife's system is nixOS, (~12 year old laptop) it runs great.

[–] thejevans@lemmy.ml 4 points 1 year ago* (last edited 1 year ago)

I recently set up my partner's 2012 MacBook Air with nixOS and it's been a fantastic machine. I already had a nixOS configuration from my laptop, so it took all of 30 minutes to install and get to virtually the same state as my primary laptop.

[–] Drito@sh.itjust.works 3 points 1 year ago

I tried Nixos but it was overkill for my desktop usage. The learning time is a cost but also, on my old laptop, there is a noticeable performance loss comparing to arch. The benefits is not enough for my usecase. I prefer dealing with arch shitty updates.

[–] elia169@kbin.social 3 points 1 year ago

Using it on a somewhat old Microsoft surface laptop, and it's been really great. I really like nix for packages, but nixos got very, very cool when I was able to switch DE by changing two lines in the configuration file and everything just worked. It's very hard to break too, which is useful for me...

[–] Cralex@lemm.ee 3 points 1 year ago (3 children)

I wanted to install it on my Pinebook Pro (AARCH64, with Tow-Boot installed to SPI) but I haven’t gotten it working.

load more comments (3 replies)
[–] charje@lemmy.ml 3 points 1 year ago

I've been using Guix system for a couple years and am really liking it. I got a new computer and put popos on it for the seamless Nvidia drivers, but I still have guix package manager and Guix system on other computers.

[–] robin@beehaw.org 3 points 1 year ago

I installed it last week. It's been pretty chill so far. I love the fact that my system is fully reproducible and version managed by git. Everything I need has been available. It feels a bit like the AUR to me: I need something, I look in nixpkgs and it's already there.

One thing I do find annoying is dependencies for work projects. It took me about an hour to figure out that some library our rust project depended on, expected some specific version of gdk or something, and that's why the project wouldn't compile. But apart from that, very nice and would definitely recommend!

[–] ryn@lemmy.ml 2 points 1 year ago
load more comments
view more: next ›