• @rutrumA
    link
    fedilink
    English
    711 months ago

    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.

    • @blotz@lemmy.world
      link
      fedilink
      6
      edit-2
      11 months ago

      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.

      • @MaliciousKebab@sh.itjust.works
        link
        fedilink
        English
        2
        edit-2
        11 months ago

        It actually recommends using nix-env -i, which is even worse because with that command it searches the whole repository instead of just getting the correct attribute on nixpkgs. It takes half a minute to run the command, it’s insane.

    • λλλ
      link
      fedilink
      111 months ago

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

      • @rutrumA
        link
        fedilink
        English
        111 months ago

        Add this to your nix.conf: experimental-features = nix-command flakes

        Then check out nix --help.