Skip Navigation

Good Nix OS series: five articles for new users.

48
48 comments
  • What's up with the ux design of nix? I get it's made for advanced users but still. I'm reading through this guide and man it's convoluted.

    The different ways of installing packages. Either through editing the configuration.nix or running a command. The weird inconsistency of nix commands. nix-env -iA to install and nix-env --uninstall to uninstall. Then updating uses nix-channel --update but upgrade uses nixos-rebuild switch --upgrade. All this to use the package manager. Also haven't even mentioned flakes or home manager.

    It's a cool OS, but the UX really needs work imo.

    [Edit] I do wanna add something else too because I feel like my point isn't getting across.

    It's okay to have a complicated ui. Especially if your target audience are tech-savvy. But even tech-savvy people have to start as new users. A tech-savvy new user isn't going to know what the best practices are. Being able to anticipate the steps for installing a package is important for ux. If the commands for installing packages isn't cohesive/intuitive, then the user has to spend more time looking for guides and learning how to use the software.

    People also mentioned a new command in the works. This is great! However, these current commands are being recommended through blogs and nix. New users won't know about this new command.

    36
    • There is controversy in the nix world because nix flakes were (some say) merged without proper vetting first. OG nix diehards don't want to taint nix documentation with 'experimental' flakes. But probably the majority of nix users are all in on flakes. So you have documentation from the OG camp that doesn't include flakes, and you have innumerable unofficial guides for the flakes way. This on top of the quirkiness of nix the language and the multiple ways to do things. Unfortunate.

      IMO nix-env was a mistake. It feels like an imperative package manager which may be comfortable to new users who are used to apt or similar. But really what you should be doing on nix is maintaining *.nix files which document/specify your system setup, and nixos-rebuild to update your system to that configuration. Similarly, nix channels are an imperative holdover, which can be done away with if you use flakes, which results in your current nixpkgs version being documented in a system level flake.lock file.

      20
      • I think both nix-env and flakes are designed with making package management easier. Nix-env tries to make it intuitive and familiar for new users. Flakes improve package management by simplifying the configuration.

        Personally I would love to see syntax highlighting, language server, code completion. Maybe all in a dedicated application which is configured to give the easiest experience for new users. If nix is intended to be managed through config files, then the experience of writing a config should be as easy as possible.

        4
    • They have resolved this exact problem. There is an "experimental" cli tool that fixes a lot of your complaints about nix-env, nix-channel, etc. Itcs wrapped together with "flakes". This newer feature is a little different, and working with or without flakes segments the community AND the types of articles about nix, like this one.

      As far as I know though, nixos related thing still have a bizarre set of commands, and even with flakes "nixos-rebuild switch --upgrade" is still how you switch configs.

      And as far as installation goes, using nix-env -iA really is a bad practice. Thats installing something ad hoc like you would in any other package manager. That defeats the point of nixos, where your configuration file explicitly defines all the packages you need installed, and nothing else. Nix will remove any packages you didnt specify.

      7
      • Oh that's good that they are addressing those issues with a new command. Hopefully it gets into stable soon.

        Might be that nix-env -iA is bad practice! I'm strictly talking about ux design here and nix-env -iA is being recommend by blogs and nix themselves. (Nixpkgs tells you how to install using nix-env -iA)

        A new user isn't going to know what bad practice is.

        6
      • What is this experimental tool called so I can read more about it?

        1
    • I do think it's important to emphasize the difference between installing software in user environments and system wide, which is why the tool is named nix-env. System packages must be installed via the nixos configuration file and a rebuild.

      To me the biggest missing piece for new users is a tool to help manage your system configuration and reduce the frustration of having to constantly look up nix syntax or nixpkgs quirks. Maybe thinking of it as a nixos/nix IDE? Also a polished distribution built on nixos would be a good starting point (and easy to do, I didn't realize I could just copy someone else's configuration until well after I had my system working well enough)

      The other thing that got me starting out is the need to garbage collect old packages. It's not strictly necessary if you have a large enough disk, but it took me several iterations of filling my root partition before I figured out how to properly clean up old generations.

      6
    • Imho I wouldn't bother with nix-env or nix profile. It just creates a secondary list of packages that needs to be maintained and it's cumbersome to do so. There's nix-shell or nix shell if you need a package temporarily and there's your configuration.nix or flake for everything else.

      Side note: nix profile at least has consistent commands: install/remove/upgrade

      4
    • After trying out Nix as a package manager I realized I have a pretty different world view than the makers of Nix. I agree with the end goal but how they are trying achieve it is just alien to me. The nix command line is just downright user hostile.

      I am personally hoping that someone else takes a stab at the Nix concept but have accepted Nix isn’t for me.

      4
    • The errors are also pretty terrible, usually the thing that interests you is buried under a lot of text that makes troubleshooting a real pain.

      3
    • I've read so many things that try to explain what flakes are, and for the life of me I still don't understand what they are or what they're for lol.

      3
    • What's up with the ux design of nix? I get it's made for advanced users but still. I'm reading through this guide and man it's convoluted.

      The different ways of installing packages. Either through editing the configuration.nix or running a command. The weird inconsistency of nix commands. nix-env -iA to install and nix-env --uninstall to uninstall. Then updating uses nix-channel --update but upgrade uses nixos-rebuild switch --upgrade. All this to use the package manager. Also haven't even mentioned flakes or home manager.

      It's a cool os but the ux really needs work imo.

      [Edit] I do wanna add something else too because I feel like my point isnt getting across.

      It's okay to have a complicated ui. Especially if your target audience are tech savvy. But even tech savvy people have to start as new users. A tech savvy new user isn't going to know what the best practices are. Being able to anticipate the steps for installing a package is important for ux. If the commands for installing packages isn't cohesive/intuitive, then the user has to spend more time looking for guides and learning how to use the software.

      People also mentioned a new command in the works. This is great! However these current commands are being recommended through blogs and nix and new users won't know about this new command.

      1
    • Here's an example of a tutorial that uses flakes and the new cli. You might glance through here to see how the syntax compares: https://zero-to-nix.com/start

      0
  • Since I'm already a NixOS user, I thought to check out Series 4. One of the steps was "install flatpak"

    My disappointment is immeasurable and my day is ruined.

    29
  • everyone here will hate me for bringing this up, but i tried to install nixos on hyperv, but wasn't able to.

    8
  • Okay, 3rd article is just plain wrong. Don't ever use nix-env for installation, unless you know why you're doing it instead of the other options.

    1
  • Use multiple versions of the same package

    Shameless self-plug, you can use my project, https://history.nix-packages.com, to find available versions.

    1
You've viewed 48 comments.