• pr06lefs@lemmy.ml
    link
    fedilink
    arrow-up
    20
    ·
    10 months ago

    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.

    • blotz@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      10 months ago

      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.

      • itslilith@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        5
        ·
        10 months ago

        Syntax highlighting, LSP and code formatting work flawlessly for me using Helix, and therefore should on any editor that implemented LSP

      • pr06lefs@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        10 months ago

        The intent of nix-env was to make it easier, but the effect was to push some of your system state into a shadowy ‘env’ realm that is not managed by your *nix files. Same with channels - its state that isn’t in your configuration.nix.

        To me the whole point is to have all your state in some files you can check in to version control, and use to reproduce your system.

        Agree it would be cool to have a way to edit nix files that would give you all the args to functions, code completion etc. You do get some of that with the nix repl. Would be nice to even have a GUI for selecting packages for those that don’t “do” text editing.

        I’m using nixd for a nix language server, but haven’t seen a lot of benefit so far to be honest. I think part of the reason is nixpkgs isn’t pulled in until runtime, so most things are undefined as far as the lsp is concerned. Haven’t put a lot of time into it, there may be ways to make it more useful.