Code Monkey home page Code Monkey logo

Comments (4)

shajra avatar shajra commented on July 18, 2024

Hi @BadDecisionsAlex.

Thanks for the feedback!

I intentionally avoided nix-shell -p for a few reasons. I use nix run these days instead of nix-shell -p, which I like a touch more. There's an issue that discusses the reasons for my preference: NixOS/nix#726. Here's what my usage would look like:

nix run \
    nixpkgs.hello \
    '((import <nixpkgs> {}).haskellPackages.ghcWithPackages (ps: [ps.dhall]))'

I don't think this is too verbose, and I also think my tutorials cover enough information to explain how this works. Personally, I like some of the new Nix 2.0 commands. nix-shell is awkwardly overloaded with a lot of usages (debugging Nix expressions, developer environments, running commands). I do discuss nix-shell in the tutorials, but I was hesitant to discuss ways to use it that were redundant to other methods already shown. My goal was to make more singular recommendations congruent with my own usage, since in Nix it's easy to get decision fatigue.

Hopefully this all explains my thoughts. Right now my inclination is to leave things as they are, but I welcome more discussion. There might be a change to make still.

Thanks again for checking out the repository!

from nix-example.

aakropotkin avatar aakropotkin commented on July 18, 2024

Hey Sukant do you use hdevtools or a linter with Haskell and Vim?
I have been having issues getting mine to play nicely with Nix. You know the issue already I bet; once I'm inside a Nix Shell, my linter is still referencing my global packages and whines about "missing modules" because it can't see the shell's Haskell Packs.

Cook says howdy and hopes you're well. He spent half of his previous lecture talking about eating edibles in Amsterdam and marijuana legalization instead of closure diagrams lol.

from nix-example.

shajra avatar shajra commented on July 18, 2024

Hey @BadDecisionsAlex,

I realize now the connection between the account and the human. Good to know Cook is doing well and enjoying all of his favorite plants and related legislation.

Regarding you usage of nix-shell, you seem to understand the problem pretty well. You need to run these tools from within a nix-shell, I think. There's other ways to solve the problem too. What I do with Emacs is set it up with direnv-mode. With direnv, I can get my environment from nix-shell per buffer/file.
Otherwise, you have to do aliasing/scripting/configuration/whatever to get all these tools to integrate with nix-shell. Another way to deal with the problem is to just go into the nix-shell, and then run your editor and tools from there. But that can be annoying when hopping from project to project.

I don't use hdevtools. There's so many of these things out there. The more stable ones I know of are ghcid (pretty plain, and not editor-integrated), intero (emacs-only, stack-only), and dante (emacs-only, stack-independent).

Additionally, there's this more complicated thing call the HIE server, which people normal figure out when using VSCode. From what I've seen, the HIE server doesn't seem too unstable but it's Stack-dependent. You can get the HIE server working with Emacs and Vim, I'm sure. But from what I can tell, HIE is a little bit more tricky to get working with Nix (versions of dependencies are different from what's in Nixpkgs).

That leaves ghc-mod and hdevtools, which I often hear about more from Vim users, which I haven't been for some time. Unfortunately, these tools also seem a bit more finicky.

So all I've gotten to work really well with Nix is the exact Emacs configuration I detail in this project. I hat that I'm so locked into Emacs. I love Emacs, but it pains me to not have more solutions for other people interested in Nix. Because I like Nix so much, I don't want to be tied to Stack, but unfortunately, that's what so many of these tools depend on. I have a lot of respect for the simplicity of ghcid, but Dante+Emacs gives me a tidier in-editor experience.

As for a linter, I do have Dante set up to give me not only compiler warnings, but also hlint warnings too.

All of this is documented in this repo under tools/README.org. But it pulls you into my exact toolchain, which I know is highly subjective.

from nix-example.

shajra avatar shajra commented on July 18, 2024

Hey @BadDecisionsAlex, I'm going to close this issue. The conversation has been great, though. If there's something you'd still like to see implemented, please free to reopen the ticket. I'm happy to keep the conversation rolling. I'm just pruning my backlog.

from nix-example.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.