• Blue_Morpho@lemmy.world
    link
    fedilink
    arrow-up
    57
    arrow-down
    8
    ·
    3 months ago

    I’d been hearing a lot about NixOS so I did a VM install. It wanted me to setup my own partitions manually without even giving preset sane defaults like I was back in 1994 installing Slackware.

    Nope. My OS is a tool, not a lifestyle.

    • Laser@feddit.org
      link
      fedilink
      arrow-up
      15
      arrow-down
      1
      ·
      3 months ago

      This is the opposite of me. I always get nervous when I don’t have precise control over how the disk layout looks. I explicitly decided for the non-graphical installer when I first downloaded NixOS

    • qqq@programming.dev
      link
      fedilink
      arrow-up
      9
      arrow-down
      1
      ·
      3 months ago

      Sounds like you haven’t done it in a while. It has calamares installer now.

    • turnipjs@lemmy.mlOP
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      3 months ago

      How long ago did you try? You should try again, I did not have this experience setting up with the graphical installer a few weeks ago.

    • cizra@lemm.ee
      link
      fedilink
      arrow-up
      6
      arrow-down
      2
      ·
      3 months ago

      The obvious sane default is 1 partition covering the whole disk, + EFI system partition. What’s there to offer…

      • Laser@feddit.org
        link
        fedilink
        arrow-up
        8
        arrow-down
        1
        ·
        3 months ago

        Encryption? Also you’re assuming there’s only one block device…

        assuming the person before did not just mean partitioning, but also all other storage-related tasks

    • Wooki@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      3 months ago

      it wanted me to setup my own partitions manually

      You’ve obviously never used nix, it’s GUI installer can auto configure just fine.

      When your OS AND apps are declared and stateful a lot of risk and complexity is removed. Configuring is just a bad experience with poor usability and worse documentation.

    • suction@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      Where do you draw the line though between tool and lifestyle? At setting up partitions (which is a trivial thing I would not mind at all)?

  • ColdWater@lemmy.ca
    link
    fedilink
    arrow-up
    34
    arrow-down
    1
    ·
    3 months ago

    NixOS is cool, the whole Linux configuration in one file is convenient but I already found my home and comfort place that’s Arch btw don’t think I switch to other distro anytime soon

    • Laser@feddit.org
      link
      fedilink
      arrow-up
      15
      arrow-down
      1
      ·
      3 months ago

      Just to clarify, I wouldn’t recommend putting everything in a single file, but rather modularize the configuration.

      I also came from Arch, but have since abandoned it, and I don’t think I want to use distributions for myself that use the the classic imperative concept. One you get a better understanding of it, it makes so much more sense.

  • TheWordBotcher@lemmy.world
    link
    fedilink
    arrow-up
    24
    ·
    3 months ago

    As someone who has never tried Linux, this meme has done more to make me want to give it a try than anything else Linux users have thrown at me so far. The fox is very convincing. I might step into the back of an unmarked van if it asked me to.

  • vga@sopuli.xyz
    link
    fedilink
    arrow-up
    23
    arrow-down
    4
    ·
    edit-2
    3 months ago

    I actually got NixOS after the latest time I tried it. But I also got that I don’t want it, Arch is much simpler in all the good ways.

    And perhaps something like https://github.com/kiviktnm/decman can some day give us part of Nix’s power without going all-in with the functional declarative thingamadoodle.

    • archer@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      Wow thanks I was wondering for a while if something like this existed! I’m very happy with regular Arch, but I am very curious to try both an immutable/atomic and a declarative distro. At least the second I guess I can kina replicate now with this. Another rabbit hole to go down I think. :D

  • QuizzaciousOtter@lemm.ee
    link
    fedilink
    arrow-up
    18
    arrow-down
    1
    ·
    3 months ago

    I mean, it’s like a fucking drug. The learning curve is steep AF but past some point, when it starts making sense, it’s just incredible. I’m currently moving my whole setup to NixOS and I’m in love.

    • Laser@feddit.org
      link
      fedilink
      arrow-up
      13
      arrow-down
      1
      ·
      3 months ago

      Even when using in a basic way, I think it has one very tangible advantage: the fact that you can “compartmentalize” different aspects of your configuration.

      Let’s say I set up a specific web service that I want to put behind a reverse proxy, and it uses a specific folder that doesn’t exist yet, like Navidrome which is a web-based audio player. It requires a set of adjustments of different system parts. My nix file for it looks like this:

      { config, ... }:
      
      let
        domain = "music." + toString config.networking.domain;
      in
        {
          services.navidrome = {
            enable = true;
            settings = {
              Address = "127.0.0.1";
              Port = 4533;
              MusicFolder = "/srv/music";
              BaseUrl = "https://" + domain;
              EnableSharing = true;
              Prometheus.Enabled = true;
              LogLevel = "debug";
              ReverseProxyWhitelist = "127.0.0.1/32";
            };
          };
      
          services.nginx = {
            upstreams = {
              navidrome = {
                servers = {
                  "127.0.0.1:${toString config.services.navidrome.settings.Port}" = {};
                };
              };
            };
          };
      
          services.nginx.virtualHosts."${domain}" = {
            onlySSL = true;
            useACMEHost = config.networking.domain;
            extraConfig = ''
              include ${./authelia/server.conf};
            '';
            locations."/" = {
              proxyPass = "http://navidrome";
              recommendedProxySettings = false;
              extraConfig = ''
                include ${./authelia/proxy.conf};
                include ${./authelia/location.conf};
              '';
            };
          };
      
          systemd.tmpfiles.settings."navidrome-music-dir"."${toString config.services.navidrome.settings.MusicFolder}" = {
            d = {
              user = "laser";
              mode = "0755";
            };
          };
          systemd.services.navidrome.serviceConfig.BindReadOnlyPaths = ["/run/systemd/resolve/stub-resolv.conf"];
            
          security.acme.certs."${config.networking.domain}".extraDomainNames = [ "${domain}" ];
        }
      

      All settings related to the service are contained in a single file. Don’t want it anymore? Comment it out from my main configuration (or whereever it’s imported from) and most traces of it are gone, the exception being the folder that was created using systemd.tmpfiles. No manually deleting the link from sites-available or editing the list of domains for my certificate. The next generation will look like the service never existed.

      And in my configuration, at least the port could be changed and everything would still work – I guess there is room for improvement, but this does what I want pretty well.

        • Laser@feddit.org
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          Technically correct, but the settings in there are not service specific. However, if there’s something worthy of reworking it’s probably the Authelia part

      • tux7350@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        Hey this is a great web server example! Instead of commenting it out to enable or disable you can actually turn it into a full module. Check out this example of a nix module. Basically, you can take your code you pasted and put it under the config set. Then create an option to enable that set of code. Now you can always have this nix file imported, but enable the option only when you need it with another declaration. Really, that’s how all the declarations work you’re just getting the nix files from github and nixpkgs.

        • Laser@feddit.org
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          Thanks for the answer; I do have at least one module in my config, but usually, I don’t enable or disable services like that, it was more of an example of how the configuration is split up and what the advantage of that is. In the end, if the only option is to enable the module, you’re not gaining that much if you need to import and enable it instead of just importing the configuration straight is my opinion.

      • sunstoned@lemmus.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 months ago

        Love the example here!

        I’m still learning about available references (ex config.services.navidrome.settings.Port). What resources did you find to be the best for learning that kind of thing?

        I’ll accept RTFM if that’s applicable :)

        • Laser@feddit.org
          link
          fedilink
          arrow-up
          3
          ·
          3 months ago

          Well, a lot of it is just trying stuff out, but let’s say you want to setup Navidrome because you read about it somewhere. My first step is always to go to https://search.nixos.org/options? and search for it, it’ll show you the options available. If you want to know how it’s implemented under the hood, press the “Declared in” link where it shows you the source code of the module, this can sometimes be helpful.

          Other than that, read the wiki for examples, and remember that nix is a full language and not just a configuration, so you can keep it flexible.

        • tux7350@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          3 months ago

          Use nix repl! That stands for Read Eval Print Loop. You can evaluate a nix expression and see all the attributes inside. For example, on a non-flake system, use :l <nixpkgs/nixos> inside the repl to load the current system. Then you can hit the tab key to show whats inside of the current attribute set, make sure you have a . at the end. Then you can press enter to evaluate and see the declaration. For example when you set networking.hostName in configuration.nix you can actually find it under options.networking.hostName.value evaluating that in the repl.

          • sunstoned@lemmus.org
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 months ago

            Amazing! I’ve used that before but just to look for packages offline. I’ll definitely check that out.

  • pimeys@lemmy.nauk.io
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    3 months ago

    Yes. And I feel sad because I haven’t been excited on any other OS for years after learning NixOS. I used to be excited about playing with things like FreeBSD, but now they all feel like something’s missing…

    Not for everybody, but as a software engineer nix/nixos is blessing.

    • AItoothbrush@lemmy.zip
      link
      fedilink
      English
      arrow-up
      8
      ·
      3 months ago

      Its especially annoying for me because i wanna go back to something that “just works” but i miss the nix features. I like declaring my system but managing packages declaratively is just such a pain. I just wanna do apt-get install package its just easier i dont want to rebuild my whole ass system. Something i found that may work is using nix for the system and then distrobox for packages. Yall think thats something that would work well?

      • BCsven@lemmy.ca
        link
        fedilink
        arrow-up
        10
        ·
        3 months ago

        Can’t you just do the package install via nix-env rather than the config file

      • Shareni@programming.dev
        link
        fedilink
        arrow-up
        6
        ·
        3 months ago

        Separate your system and user lists. Use home-manager for example for your user packages. I think separating those configs is the official recommendation.

        As for the rest, I’m using nix on MX because of declarative package management. Screw going back to imperative and having to remember what packages to install. If it’s something I use often it goes on a list, if I don’t nix shell comes to the rescue.

        I’d rather mess around with dev envs for nix than distrobox.

  • EnderMB@lemmy.world
    link
    fedilink
    arrow-up
    13
    arrow-down
    1
    ·
    3 months ago

    I tried it, and while I was really excited about its proposition, it felt like at times any prior knowledge of Linux was a bit wasted. I also had some significant problems with needing to pin packages.

    I don’t doubt that it’s a great option for many, if you’ve got the time to learn it. I’m finding myself in the position where I stick my flag to one distro and keep it there for as long as it doesn’t piss me off.

    • nickwitha_k (he/him)@lemmy.sdf.org
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      Yeah. I had a similar experience. My first successful install, following the docs, didn’t have a network stack. It turns out that the docs are not representative of what’s considered best practices at this point. I also don’t care for needing a new DSL for a single use case.

      So, for me, it’s a non-starter. Fedora Atomic is meeting my needs nicely at this point. NixOS has brought some excellent ideas to the forefront and is a great match for some people. I’ll pass until I can use my JSON/YAML/TOML and the docs are useable.

  • LiveLM@lemmy.zip
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    2
    ·
    3 months ago

    Last I heard they were having this huge governance drama. They fix that yet? Or…

  • F04118F@feddit.nl
    link
    fedilink
    arrow-up
    11
    arrow-down
    1
    ·
    3 months ago

    Don’t listen to him! Just start using Nix to manage dependencies and dev environments for your projects but keep your OS the same until you are really good at Nix

  • truxnell@infosec.pub
    link
    fedilink
    arrow-up
    9
    ·
    3 months ago

    Most definietly, I have my entire homelab setup in nix as well as laptop/desktop. Is a hell of a lot easier and more reliable than the Kubernetes setup it replaced…

    • Shareni@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      Damn you broke my brain for a second there. I thought you meant that nixos replaced k8s, and was wondering what the hell are you talking about.

      • truxnell@infosec.pub
        link
        fedilink
        arrow-up
        3
        ·
        3 months ago

        Haha yeah could have worded better. I was running a 3 node k8s cluster on Talos Linux as my homelab. Downsized/simplified to a single NAS (aka NixNAS) + NUC on nixos and split the services between them. Apps that heavily use the NAS live on it for direct file access, the rest hum along on the nuc. I sleep easier with this, rather than fighting nose breakage during upgrades or wondering when my next ceph failure will occur.

  • Mia@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    7
    ·
    3 months ago

    Yes, it’s the most stable yet infuriating experience I’ve ever had with Linux. I’m currently using it, but I don’t know for how much longer…

      • Mia@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        7
        arrow-down
        1
        ·
        edit-2
        3 months ago

        Definitely more stable than Arch. Plus, you can easily roll back if something breaks, and you can choose which packages should use the unstable branch while keeping the overall system stable, which I find amazing. I don’t think I’ve ever had a breaking update, which I can’t say about Arch.

        The problem I have with Nix is that you can effectively forget about running random programs or GitHub projects. You either package everything the Nix way or nothing works. As a developer and someone who often likes to try stuff out, that’s really annoying. And Nix, the language, is ass, so is the whole build system. Nobody can convince me otherwise.

        • BrucePotality@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          2
          ·
          3 months ago

          I agree with this, not being able to install things globally or use other package managers like pip was really annoying. I didn’t spend that much time with it to be honest, but just simply trying to set up a dev environment wasn’t fun. Also I’m pretty sure elixir doesn’t work on nix at least when I tried it

          • Mia@lemmy.blahaj.zone
            link
            fedilink
            arrow-up
            3
            ·
            3 months ago

            It’s not really the same thing though, those are filesystem snapshots, not package registry snapshots. Think of Nix generations as blueprints of how to construct your OS and environment, not the files themselves (though those are certainly required). I’m not quite sure how to explain it, but it’s a lot more powerful than what basically amounts to a backup.

      • tatterdemalion@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        3 months ago

        You should say “unstable channel”. It’s literally just a rolling release that pulls from the nixpkgs master branch. So it’s only as stable as it needs to be to pass the Hydra CI tests.

        And if you get to a working version, you can pin that as a Nix flake to avoid anything breaking until the next time you nix flake update.

      • histic@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        3 months ago

        Not anymore then arch imo unstable is just rolling release compared to the specific versions which are more like fedora or similar