• msherburn33@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    29 days ago

    The Nix language itself is the hardest part.

    Let me disagree there, the language is trivial. It’s just JSON-lookalike with expressions, with a lot of nice touches that make using it much easier than all the alternatives (e.g. sane multi-line string handling, lazy evaluation, default values, powerful key/value sets, etc.). The only real stumbling for me when first encountering it was realizing that functions can only take a single argument (which can be a key/value set) and that functions are literally just : (e.g. (a: a + 5) 6 => 11). That’s easily missed if you just look at a file without reading the documentation.

    The thing that makes it hard is just the complexity of the actual package collection, your configuration contains literally your whole system, and it’s not always obvious where to find the thing you need, since sometimes it’s a plain package, sometimes it is a services.foobar.enable = true and sometimes you have to fiddle with override or other package specific things. Knowing that https://search.nixos.org/ exists is half the battle here.

    There is also the lack of static typing that can lead to rather verbose error messages, but it’s not like many other configuration formats have that either.

  • chaospatterns@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    28 days ago

    I really want to like Nix. The idea of declaratively defining my entire system sounds great. I can manage it with Git and even have multiple machines all look the same. I can define my partititioning once and magically get a btrfs disk working. Wow!

    But I find the language confusing no matter how many times people say it’s easy. I have a lot of experience with other programming languages so maybe it just doesn’t mesh. It also gives terrible error messages that are hard for me to understand. And Nixpkgs is unpredictable for what version I’m going to get. One of the services I installed ended up being a release candidate version which was a surprise. What if I don’t want the latest version of Docker? How do I pin it? Do I have to duplicate part of Nixpkgs? It just feels like a monorepo where everybody has to be on the same versions. Why on earth do the Nix language docs start by introducing math expressions instead of here is a simple self contained thing that installs one program. Here’s how you configure it. Here’s how you expand. Why does the dependency graph seem to pull in so many unnecessary dependencies? For example, I tried to build a minimal Docker image (which Nix looks to be a very good fit for), but I couldn’t figure out how to strip out dependencies that likely were only used during build for a dependency.

    I still like the idea and have managed to get my server defined entirely with NixOS which is very cool, but I can’t recommend this to my tech friends because if I’m confused they will be more so.

  • phantomwise@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    27 days ago

    I’ve been stuck on Nix for two weeks because I thought it would be a good idea to put a distro I had never used but that wouldn’t break on my backup laptop in case my main one ever broke. I just couldn’t force myself to install debian, not that I have anything against debian, it’s just… kinda boring, while Nix seemed very interesting. IT SEEMED LIKE A GOOD IDEA AT THE TIME I SWEAR.

    Guess what happened… I broke Arch. Then I reinstalled and the next day the laptop broke. Then the next day I tried to get my data back and the hard drive broke. So, backup laptop with Nix for two weeks…

    • I really really really like the declarative stuff. Installing packages through config files is so nice I’ll never lose track of what I’ve installed ever again 🥰 🥰 🥰 I was already using a git repo for all my config files + GNU Stow to symlink everything to its proper place, so adding the .nix configs to that setup was very easy.
    • Having a clean system on rebuild is great. No more clutter left everywhere that I don’t know about, no more half broken stuff left lying around.

    But…

    • It’s not Arch. Not Nix’s fault, but I kept hearing that it would be “like Arch but declarative”… and it’s really not 😑 Everything seems over-complicated vs as simple as possible.
    • I absolutely hate the language.
    • What’s with those error messages from hell???
    • And speaking of hell, every language that can’t just use indentations like YAML instead of cluttering the code with {} and [] and () should have been relegated to the darkest pit of hell 20 years ago. But points to Nix for being less awful than JSON (the comma on every line but not the last thingy make me want to build a time machine to go murder the grandparents of whoever thought it was a good idea)
    • Packages are out of date even in the unstable branch (I know it’s unfair since it’s not trying to be a rolling release… but… but…)
    • Where are the source packages? Is that an Arch only thing? I liked having packages that automatically use the latest git commit without needing to manually install from source and manually reinstall each time I want an update like a medieval peasant… 😭
    • Nix packages are weird. Even someone who’s terrible at coding like me can read Arch PKGBUILDS… I miss you Arch 😢
    • Apps not working because of paths that don’t exist on Nix… what do you mean I need to patch the package myself? 😭 But at least there’s steam-run, great preserver of what’s left of my sanity.
    • Can’t wrap my head around installing some stuff like VSCode extensions (the advice I got was "don’t bother just do it imperatively…) (Edit: Finally figured it out!!!)
    • Wiki is often sparse on info and not very helpful if you don’t already know what you are doing (and I clearly don’t 😅)
    • Hidden configs. Some stuff works on its own like pipewire even though I haven’t installed or configured it (I went with a minimal install that just gave me a tty then build from there, no DE), and how it’s already configured is not in the default config files. It’s very confusing not knowing why some stuff works and how it’s configured by default.

    But it’s kinda growing on me. Like mold. Or cancer. Brain cancer.

  • utopiah@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    30 days ago

    Meanwhile me as a barbarian installing Debian and copying my ~/.bashrc file (and a few others) if not just remounting /home/ in the new installation every few years.

      • SolarBoy@slrpnk.net
        link
        fedilink
        English
        arrow-up
        1
        ·
        29 days ago

        This command will just run an executable file on nix. Normally only executables which are installed from the package manager will work.

        appimage-run is another option. Which can be used to run, you guessed it, appimages

        • iopq@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          28 days ago

          But appimages will complain about unmet dependencies, so usually they don’t work

  • traches@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    30 days ago

    I like the idea of nixos, but I feel like it makes a bunch of daily sacrifices in order to optimize a task I do once every few years? I hardly ever get a new computer, but I install/uninstall/update/tweak packages on my system all the time. With a dotfile manager and snapshots, I get most of the benefit without any of the drawbacks.

    • feddup@feddit.uk
      link
      fedilink
      English
      arrow-up
      0
      ·
      30 days ago

      Loved nixOS but couldn’t install PIA VPN gui and disliked the workarounds. Also doing .net dev was more awkward than I liked so went back to Arch and wrote some scripts to install all the packages I want instead. Love the idea of nixOS though.

        • feddup@feddit.uk
          link
          fedilink
          English
          arrow-up
          1
          ·
          29 days ago

          I have no idea how and given there’s been a lot of people asking the same thing I don’t think it’s as trivial as packaging some binaries.