• lily33@lemm.ee
        link
        fedilink
        arrow-up
        14
        ·
        11 months ago

        It’s a somewhat immutable distro, that is however fully configurable.

        1. The configuration is all in one place. No more changing a bunch of files in /etc, some in /lib, etc, and having to remember all files you’ve changed.
        2. You can easily recreate your system from your configuration or boot to older configuration.
        3. You can easily open shells with different programs available. Very useful for development, when you need a reproducible environment with the project’s specific dependencies.
        4. Very hard to learn, but if you have learned it well, a lot of things become easier than in other distros.
        • baduhai@sopuli.xyz
          link
          fedilink
          arrow-up
          2
          arrow-down
          5
          ·
          11 months ago

          It’s a somewhat immutable distro

          NixOS is an immutable distro. Immutability is binary, it either is, or it isn’t.

          • lily33@lemm.ee
            link
            fedilink
            arrow-up
            3
            ·
            11 months ago

            /nix/store is immutable. But there are some files in other places like /etc and /var that are mutable. Also I (or a malicious executable) could, in theory, delete store symlinks and replace them with mutable files. Impermanence helps, but you’ll still want some mutable state.

            Fully immutable systems have everything outside of /home read-only. NixOS is not one of them.

            • baduhai@sopuli.xyz
              link
              fedilink
              arrow-up
              1
              ·
              11 months ago

              I see.

              I don’t really get the malicious software point though. All immutable distros have a mechanism for changing, after all they need to be updated. If a malicious executable has root access, which is what you need to change symlinks on NixOS (I know services often get their own user, but unless modified, only root has access to those users), then these malicious executables could also leverage whatever mechanism for change other immutable distros have, to do malicious things, no?

              Though I do agree with you, now, that NixOS isn’t immutable.

              • lily33@lemm.ee
                link
                fedilink
                arrow-up
                1
                ·
                11 months ago

                There are ways to secure the update process. For example, you can enable secure boot and store your secure boot keys encrypted (or on a smart card). Then (if a full chain of trust is implemented) to update your system, you’d need to enter the private key password (or insert the smart card), and a root-access executable couldn’t to that automatically.

                • baduhai@sopuli.xyz
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  11 months ago

                  Yeah, but do other distros do this though? Not that I’m aware.

                  And surely the same could be done to NixOS, no?

                  • lily33@lemm.ee
                    link
                    fedilink
                    arrow-up
                    1
                    ·
                    edit-2
                    11 months ago

                    I think it can in theory, but there will be some problems. But most likely Silverblue or something else would have its own problems trying to implement something like that - I don’t have any experience with them and don’t know how they’d compare.

      • metasyntactic@infosec.pub
        link
        fedilink
        arrow-up
        9
        ·
        11 months ago

        The control and deterministic nature of it is amazing. I have a git repo for all of my machines entire config. I have no fear that installing something will break or make things that would require blowing away and reinstalling. Also blowing away and reinstalling is no big deal, as is building new boxes. It has a high bar for learning to use it effectively, but the view is worth climbing the mountain.

        • jecxjo@midwest.social
          link
          fedilink
          English
          arrow-up
          3
          ·
          11 months ago

          How configurable is the build process for individual applications? I run Gentoo, have all my config files stored in a git repo which includes the defaults supplied to any application’d configure/make/make install steps.

          • lily33@lemm.ee
            link
            fedilink
            arrow-up
            2
            ·
            11 months ago

            You could apply patches or change the build process. But there are some limitations to ensure reproducible builds. For example, compiler optimizations that break reproducibility are disabled.

            I think you could disable build reproducibility to get rid of those limitations, but I haven’t tried it.

            • jecxjo@midwest.social
              link
              fedilink
              English
              arrow-up
              1
              ·
              11 months ago

              The way I run Gentoo would be the type of thing to break reproducibility, getting rid of features globally that I never need. I keep getting the itch to run NixOS but then I remember rebuilding my Gentoo build from scratch is a weekend task I don’t have time for as I’m too frugal to actually upgrade my hardware.

              • lily33@lemm.ee
                link
                fedilink
                arrow-up
                1
                ·
                11 months ago

                While technically possible, you wouldn’t want to compile everything locally on NixOS. Only packages that you’ve made changes to (such as applied a patch) will be built locally, and everything else (by default) will be pulled from the precomputed binary cache.

                You can disable the binary cache, or make changes to every package. The thing is, if you update a nix package, you’ll have to rebuild everything that depends on it, and with lower-level components, that can be literally everything. It’s not a sustainable workflow.

                NixOS is not the most efficient distro either. I already mentioned some compiler optimizations are disabled by default, because they break build reproducibility. It also tends to use more disk space than other distros. So actually trying to super-optimize every package on it is somewhat pointless.

      • I use NixOS btw @lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        11 months ago
        1. My config is in a single github repo for all of my machines and my user.

        2. It’s really tightly integrated and just works with the nix package manager, which has a huge repo and builds packages reproducibly, so theoretically what would work on my machine would also work on yours. Also, with nix you can run software without installing it, you can have multiple versions of the same library, and there are way more benefits just from this package manager that I can’t list here.

        3. You can iteratively test your config, apply it on a live system and roll it back. You can also use git to roll back to an older version while keeping the actual source files.

        4. There’s no dependency hell / leftover packages after uninstalling something - what you declare in your config is what is installed, and if an app has unspecified dependencies it won’t build. I guess this would also be a part of #2

        And there are probably other benefits I can’t remember.