Hi everyone!

I saw that NixOS is getting popularity recently. I really have no idea why and how this OS works. Can you guys help me understanding all of this ?

Thanks !

    • Arthur Besse@lemmy.mlM
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      this comment reads suspiciously like it was written by an LLM (eg ChatGPT). was it? please don’t do that!

        • RosalynKirk@kbin.social
          link
          fedilink
          arrow-up
          7
          ·
          1 year ago

          If OP wanted a response from an LLM, they would have typed their question into an LLM. The least you could do is label it as such.

            • 20gramsWrench@lemmy.dbzer0.com
              link
              fedilink
              arrow-up
              8
              ·
              1 year ago

              Rule or not, it’s pretty lame, look at the size of your post compared to how much info it gives, had you copied a article from some basic linux news stite, it would have given mostly the same output, now think about what linking a page to an article about nixos as a response to op trying to start a conversation about it would look like, rude.

            • Zamboniman@lemmy.ca
              link
              fedilink
              arrow-up
              3
              ·
              edit-2
              1 year ago

              I use an LLM to edit everything I write.

              May I invite you to consider the pitfalls of such an approach?

              Does this mean I have to label everything as LLM-generated?

              Yes, that would be reasonable imo

                • AgreeableLandscape@lemmy.mlM
                  link
                  fedilink
                  arrow-up
                  4
                  ·
                  edit-2
                  1 year ago

                  Why don’t you label your name in every answer

                  You mean like a username that is listed in the header of every post and comment?

                • 133arc585@lemmy.ml
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  edit-2
                  1 year ago

                  Why don’t you label your name in every answer, so we can check if you are hallucinating or making things up?

                  What?

                  I’m also curious why you feel the need to have an LLM edit your writing. What did you do before an LLM? And what benefit do you feel the LLM writing your comments is offering you and those reading your comments?

        • Arthur Besse@lemmy.mlM
          link
          fedilink
          arrow-up
          7
          ·
          edit-2
          1 year ago

          thanks for clarifying. i’m deleting your generated comment per rule 4 (spamming) as well as two other generated comments you posted elsewhere; if another admin wants to undelete any of these i would be surprised.

          please do not post LLM-generated comments without clearly labeling them as such. imo this is common sense, and doesn’t need its own rule, rule 4 is sufficient.

        • AgreeableLandscape@lemmy.mlM
          link
          fedilink
          arrow-up
          5
          arrow-down
          1
          ·
          edit-2
          1 year ago

          The admins did not remove the comment, a community mod did. Mods can impose further restrictions on their communities on top of instance wide rules (within reason of course), including banning LLMs. Lemmy.ml at least does not have a blanket ban on LLMs, but generally it’s expected that, 1, you should not post LLMs excessively, we mainly want to host discussions by humans, 2, you should disclose it’s from an LLM and which one it’s from, and preferably add to what it says with your own comments or analysis. If it’s a mix of LLM and your own writing, say so at the start of the comment, but if the community directly disallows LLMs then you shouldn’t post it there at all.

        • r00ty@kbin.social
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago

          I don’t know whether just using an LLM is a problem. But in your case I would say the fact you used one and didn’t indicate you did. If you indicated the answer came from an LLM, then the trust in the answer could be weighted accordingly by each user.

          That’s my opinion at any rate.

        • barsoap@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          Under the soon to be enacted EU AI laws such a bot would be limited-risk application (interaction with humans), the requirements for a text bot aren’t particularly high but also non-negotiable from a best practice POV: Stating front and centre that it’s an AI generated post. It’s also best practice to fulfil criteria necessary for high-risk systems voluntarily, the more you can fulfil I bet the less hostile people are going to be.

          The library of congress has an executive summary of the thing.

          (EU sources alas are a bit iffy at the moment there’s the commission version and the parliament amendments, haven’t seen a consolidated version yet. When will politicians start using proper VCS)

        • Arthur Besse@lemmy.mlM
          link
          fedilink
          arrow-up
          3
          ·
          1 year ago

          Do LLMs give citations?

          do they ever!

          (The citations in this comment appear to be all real links about NixOS, but they are not particularly relevant to the places in the comment where they’re cited.)

    • NathanUp@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I would love to have #4 on Arch / EndeavourOS.I recently had my Scribus install (SVN from the AUR) break due to Arch moving to some newer library. There really isn’t an easy way to solve this AFAIK.

  • Tilted@programming.dev
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    I used NixOS for a couple of years. My experience is like this:

    1. It is a rolling release (mostly)
    2. You write a declarative configuration for your system, e.g., my config will say I want Neovim with certain plugins, and I can also include my Neovim configuration
    3. It is stable, and when it breaks it is easy to go back
    4. Packages are mostly bleeding edge
    • Atemu@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      Note that there’s both the rolling unstable channel and a bi-annual stable release channel.

      • Tilted@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Yes absolutely. It is really great. It is also a source of frustration, e.g., missing configuration options, non-obvious options and so on. Overall it works well.

      • Sr Estegosaurio@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        You can even define configurations for different systems/hosts/users from a single place. I’ev atomized my config and I can reuse lots of parts for my different machines. Also my user config is nearly identical (except hardware specific things).

    • priapus@lemmy.one
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Important to note that NixOS has both a rolling release and point release version.

    • SirNuke@kbin.social
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      Are you still using it and happy with it? I’ve been increasingly using single purpose dev VMs in a server, and a declarative configuration system would make the process of spinning them up faster and more robust. My current shell script system is clunky, and I’ve been looking at Ansible.

  • fazo96@lemmy.trippy.pizza
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    I have been using for years on servers. My lemmy instance is hosted on it.

    Although for desktop I had too many issues back in 2019 so I ended up back to Arch Linux and then EndeavourOS

    Would be fun to try again to use it on desktop

    • dbemol@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      I think I will give it a try on a server first, I don’t have a playbook or script for a reproducible set up (yet), so I may as well use Nix to see if it’s worth the hype

  • moldyringwald@kbin.social
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    It’s insanely stable but you have to have a lot of linux/programming knowledge to do even the simplest things like installing/updating your software or making little tweaks. I played with it for hours the other day and I’m just too dumb to figure it out lol I think it’s just a super stable highly customizable distro for power users and a lot of people like that. If you can get over the learning curve it’s a pretty powerful and unique os

    • Chobbes@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      It’s kind of funny because I’d put NixOS on a complete newbies computer for sure, and recommend it to an expert… But I’m less sure if I’d tell a random mid-intermediate Linux user to switch.

      Like if Grandma wants Linux on their computer to do some internet browsing for some reason… I’d absolutely put NixOS on it because it’s easy to manage the system for them… But somebody who is a little familiar with Linux already might be more confused about the differences. It’s kind of the ultimate beginner distro and the ultimate power-user distro, but a bit awkward between those extremes, haha.

    • Glome@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      It’s true that it can be a powerful distro but I’ve also heard from some users that the advanced-level documentation is lacking and only limited to forums and source code. I think maybe if the documentation was more thorough I would try nixos.

    • RosalynKirk@kbin.social
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      you have to have a lot of linux/programming knowledge to do even the simplest things like installing/updating your software

      So, pretty much like any other distro

        • RosalynKirk@kbin.social
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          Weird, every distro I’ve tried either has no management, or doesn’t work. Just spins around loading. “Uninstalling” packages does nothing but remove them from the package manager.

  • lloram239@feddit.de
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    NixOS is the only[1] Linux distribution that feels like it is build around Free Software. Meaning upstream Git repositories can be treated as first-class citizen and installed directly without convoluted binary packaging system (that still exists in the background, but only as cache to speed up build times). Nix also makes it very easy to upgrade, downgrade, side grade, patch, override dependencies or otherwise change packages, or even just keep multiple versions of the same software around. Something many other distributions still struggle with or make completely impossible with the distributions own tools. Even the act of installing software in Nix becomes somewhat unnecessary, as you can just run software straight from the Git repository.

    And best of all, it’s all based on a very simple and transparent packaging system, if you ever used GNU stow, kind of like that, it’s all held together with a bunch of symlinks and some environment variables. No contains, no ostree, none of those ugly workarounds, just plain old Unix stuff that you can find and grep through as much as you like.

    Simply put, NixOS puts the joy back in Linux, while other distributions like Ubuntu try to actively trash their reputation with a proprietary App store and others like Debian just stagnate around and are still stuck with the same old packing system that was state of the art 25 years ago and hasn’t improve much at all since than. NixOS just provides a dramatically cleaner and simpler approach that also happens to be vastly more powerful.

    Another cool thing, if you don’t wanna switch distributions just yet and reinstall the full NixOS, you can just use the Nix package manager itself on whatever distribution you are already using.

    [1] There is also GNU Guix, which is basically a reimplementation of Nix with Guile/Scheme

  • Cegorach@feddit.de
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago

    nah

    didn’t have enough time during the last half a decade to learn yet another thing

    might be better fit than my current debian setup - but how would I ever know, since my current thing is good enough?

  • featherfurl@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    1 year ago

    Here’s the straightforward version of why I use it:

    1. The entire state of your operating system is defined in a config file, and changes are made by changing the config file. This makes it super easy to reproduce your exact system many times and to know where all the many different configuration elements that describe your system are located.

    2. Updates are applied atomically, so you don’t have to worry about interrupting the update process and if it fails, the previous state of your system is still bootable. By default every time you change something, you get another option in the boot menu to roll back to.

    3. Making container-like sub systems is super easy when you’re familiar with nix, so you can have as many different enclaves as you like for different software versions, development environments, desktop setups, whatever without taking a performance hit. Old versions of stuff are very accessible without breaking your new stuff.

    4. The package manager has a lot of software and accessing nonfree stuff is straightforward. Guix looks rad, but nix ended up being the more practical compromise for my usecase. I didn’t want to have to package a heap of software the moment I made the switch.

    • SolemnAttic@feddit.de
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      This very much. I used to have lots of unchecked config and state files everywhere on Arch. Now everything is checked in and wiped on boot so if something breaks after a reboot i know what broke.

      Like how the opengl rendering did due to nixpkgs version differences

  • Syboxez@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    1 year ago

    NixOS is a fully declarative and reproducable system.

    What this means is that you can create a single configuration.nix, which includes all of your applications, settings, aliases, environment variables, user account + groups, etc., and copy that over to another NixOS machine (including different architectures) and run nixos-rebuild boot to completely reproduce the system on that other machine.

    The nix package manager is also really good at telling you if the configuration will break anything, where, and how, and refuses to apply until the issue is fixed.

    Also every time you use nixos-rebuild, it creates a new generation of your NixOS install meaning if something ends up breaking, you can reboot into the old system.

    So for example, I can theoretically have the exact same configuration across my desktop, laptop, phone, server, etc., minus the automatically generated hardware-configuration.nix, which is specific to the hardware.

    Also Nix supports package overlays, which means that you can modify an existing package while the maintainer still keeps it up to date.

    • Thenonymous Rexius@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      Oh boy my two cents time!

      I love the concept of NixOS. A fully declarative , reproduceable system from a single config repo! Sounds theoretically like it would be my kind of thing.

      Sure, theoretically, I could have a fully reproduceable system. The time spent declaring that fully reproduceable system though… I remember the first time I was trying to get my usual disk setup of, a luks encrypted btrfs partition with multi-factor enabled decryption/authentication.

      On a normal install it would take like a day at worse to install your distro. My first attempt with NixOS took me almost 4 days of screwing around in configs. 2 of those days were probably cumulatively spent waiting for the config option list of the nixos manual to search for text. And the number of redundant config options which all do the same thing! Or, are supposed to all do the same thing but in actuality, only one of them does the thing they are supposed to.

      I really want to love NixOS but it always ends up feeling like an exercise in my patience and time to do even the simplest of things. As such I find myself asking the question of, am I going to spend so much time reinstalling my distro that it’s ever worth this initial investment?

      Anyways, rant over. I actually have been debating switching back over for another try again myself I just have some very frustrating memories of my first attempts with the distro.

      • Laser@feddit.de
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Interesting, my first install of NixOS was done in a few hours and included a feature that I had not used in my previous Arch install, namely secure boot. It proved to be no issue whatsoever.

        I do agree though that you’re looking of lost without search.nixos.org, and documentation is lacking. E.g. did you know that enabling Plasma sets your main font to Noto, regardless if you’re actually using Plasma or just have it as an option in your display manager? Or when to enable a program or service rather than adding it to your system packages? Or that if you install plain obs and some plugins, the plugins won’t actually work?

        I do understand why this is the way it is and I do think it’s the better approach. But it’s not perfect.

        On the other hand, my system works very well in daily usage.

  • 20gramsWrench@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    I’m really not sure of where this would be anymore usefull than a simple bash script to install all packages you need since it doesn’t do configs and that rollbacks are supported by some filesystems already. Also Having version specific dependencies is already a thing for flatpacks and such

    • priapus@lemmy.one
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      A simple bash script is not reproducible or deterministic. Also a filesystem rollback is not the same as NixOS’s generation based rollback.

      Also, NixOS doesn’t just install packages, all system configuration is done declaratively, which would be a very bad idea to do via a bash script.

      • 20gramsWrench@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        1 year ago

        I have to check a little harder on what it does since I saw in a vid that you still needed to add your own if statement to get it working I assumed a simple

        pacman -Qk xorg-xrtrop 2> /dev/null && sudo pacman --noconfirm -S package1 package2 package3 || echo 'I aint got no x, idiot'

        would do the job as well

        • Atemu@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          I’d recommend reading some more; especially w.r.t. imperative vs. declarative.

          In NixOS, you’d do something like this:

          { config, ... }:
          
          {
            environment.systemPackages = if config.services.xserver.enabled then [
              package1
              package2
              package3
            ] else [
              # You could optionally make headless packages available here
            ];
          }
          

          You don’t need to understand the exact semantics here but you can look at it like JSON but with functions. This is not a “program”, the end-result is just data. You’re not modifying some stateful system state with new state from an uncontrolled source (i.e. the Arch repos) but rather just “outputting” a different dataset.
          NixOS then builds a concrete system out of this pure data specification. In this concrete system, those packages’ executables are available in the “global” PATH.

          You say “I want a system where x y z are installed” and it does it for you in a standardised manner. With the bash script, you explicitly tell it each step (“install x; install y; install z”). This pure data nature is what’s meant by declarative.
          This distinction rules out whole classes of issues you simply cannot run into with NixOS.

          Another aspect is that, as long as you use the same revision of Nixpkgs and the same config file, you can re-create the exact same system (almost bit-for-bit). If you were to run your bash script in a year’s time however, you’d get an entirely different system with totally different revisions of software and therefore possibly entirely different behaviour.
          This is what’s meant by reproducibility.

          You can achieve some of the same things NixOS does using imperative tools but nowhere near the same quality.

        • priapus@lemmy.one
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          I’m not familiar enough with Pacman to know what that command does. It’s definitely not as clean or easily manageable for servers as NixOS is. Especially not when you have multiple systems of which you would like some packages to be shared and others not. It also still doesn’t allow you to manage global system configurations.

    • kevincox@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      There is a world of difference between a bash script and something like NixOS. The most important difference is that with NixOS something that you don’t specify won’t be there. Whereas a bash script (or other config management tools like Puppet, Chef or Ansible) only mutate things listed.

      So it is very easy to write a script like:

      ensure_installed python3
      write_file /etc/foo.cfg 'thing = 7'
      chgrp users /mnt/backups
      

      But if you remove ensure_installed python3 it will stay installed. You can try to be very careful and always add ensure_not_installed python3 but this is both error prone and dead code as soon as you run it. I used to have a script like this and I used each of configuration management tools mentioned above and always ran into these issues. The exact error flow would be something like this:

      1. Enable/setup some service A that pulls in package X.
      2. Disable service A or remove package X because it isn’t needed anymore.
      3. Write configuration for service B.
      4. Forget to add ensure_installed X but it works anyways because X is still installed from step 1.

      Now you have a non-reproducible config because if you try to re-install or setup service B on a new machine it won’t work because X isn’t present. This may sound like a niche problem but I ran into it almost every time I tried to bring up a new machine using my config.

      It is still possible to do this in NixOS as it isn’t completely reproducible (you can have mutable state) but in general it is much harder because any configuration that isn’t specified doesn’t exist. As soon as you remove package X or service Y from your config it is removed from your system. I’ve been using NixOS for 8 years now and this problem is mostly gone. It is definitely more reproducible than bash scripts and it has a tangible effect on my workflow.

      I wrote a blog post about it a long time ago but the core is still relevant: https://kevincox.ca/2015/12/21/service-management-with-nixos/.

    • sickday@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Part of the purpose of NixOS is providing a means to build a reproducible environment that’s easy to configure, migrate, and rollout. You can absolutely handle configuration of many different programs using either flakes or the native modules provided by nix. You can customize your entire system from firewall entries, to users and their shells, to the kernel itself and the kernel modules you’d want it to load, all in a single file or multiple files. If you want to try doing all those things in bash scripts, good luck and please share your experiences but don’t expect it to be as easy as the Nix ecosystem.

  • le_saucisson_masque@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    I keep seeing trends with Linux distribution like teenager looking for new fashion.

    I think it’s mostly the very young Linux user who hope from one distribution to the another over and over whereas many just stick with what they got : Ubuntu, Debian, mint, maybe fedora.

    NixOS is certainly interesting tho.

  • Litanys@lem.cochrun.xyz
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    I’ve been using it for over a year and love it. A config file for your entire system, and built in rollbacks anytime something goes wrong. One language to configure everything, although in practice that doesn’t always work. But I love it.

    Some others have started why it works, here is some how. Nixos completely disregards the fhs. Packages don’t install to anywhere standard, every package and configuration change gets it’s on directory in /nix/store but through smart use of tracking everything there, it symlinks all those files to proper places and sets up the environment for them to know where libraries are.

    This is then also why you don’t need sudo privileges to install things. Your profile has an environment that is aware of your users packages and configurations, the system itself isn’t effected because everything is symlinked.

    Then because every update means new directories in /nix/store you can role back to your last configuration because plasma broke something or whatever.

    However, it’s a LOT to learn. Best place I know of is https://piped.video/watch?v=AGVXJ-TIv3Y&t=0

    This guy did a good job for me. Hope this helps!