Stream: nix

Topic: Nix development environments


view this post on Zulip Andreas (Apr 02 2024 at 17:28):

Hey everyone,

I am interested in improving my nix developer experience and I'd just like to know how others are setting things up for Nix development. So not development of something else with the help of a Nix provided environment, but writing Nix code itself.

Anyways, I'd like to come up with some nice or even best practices.

I want to know how to make writing Nix code less of a guessing game for me.

view this post on Zulip Srid (Apr 02 2024 at 20:31):

This is something we want to document in the larger theme of https://nixos.asia/en/dev

For now, you want to:

view this post on Zulip Andreas (Apr 03 2024 at 09:08):

@Srid Thanks for the reply!

Yes, documenting various possible setups would be a real plus!

Speaking of LSP, using nil do I get a good overview of available functions that I might wish to use? Does it pick up stuff from my project's own lib for instance? Or from the one defined in nixpkgs?

On the CI side, do you have a nice github actions workflow for CI?

Did you ever try running GitHub CI locally via something ike https://github.com/nektos/act ?

Maybe some other experienced people might want to share their perspective, too? @David Arnold or @Jonathan Ringer or @John Bargman or @Robert Hensing or @Shivaraj B H or @Las @Tim DeHerrera and @tgunnoe ? I probably missed a few people who are also doing a lot of Nix here... feel free to chime in!

view this post on Zulip Tim DeHerrera (Apr 03 2024 at 15:05):

nixago is nice for config generation. I've used pre-commit hooks in the past though haven't used any lately. I use direnv most of the time unless the shell is annoyingly heavy.

Nil is a good as an LSP so far. I've been thinking of trying nixd, which uses the C++ nix evaluator as a backend to see how it compares, but haven't tried it yet. I also use helix with #2608 patched in since there tend to be a lot of file paths in Nix files.

FWIW, I have personally contributed some nice additions to helix that make it particularly nice for working with Nix files.

view this post on Zulip Tim DeHerrera (Apr 03 2024 at 15:08):

As for the CI question, I use std-action wherever I can. Hyrda is an annoying bloated beast. I have been thinking that it might be useful though, to take the same idea and architecture behind std-action and decouple it from relying on the std API so that you can just use it with any Nix project. Might do that at some point

view this post on Zulip Andreas (Apr 03 2024 at 17:18):

Do you guys @Srid and @Tim DeHerrera have some readily available actionable example flakes you could point me to that you are using?

view this post on Zulip Srid (Apr 03 2024 at 19:11):

For self-hosted runner? I have https://github.com/srid/nixos-config/tree/master/clusters/github-runner

But it needs tidying up followed by a tutorial or something

view this post on Zulip Arnold Schrijver (Apr 06 2024 at 06:31):

Tim DeHerrera said:

As for the CI question, I use std-action wherever I can. Hyrda is an annoying bloated beast. I have been thinking that it might be useful though, to take the same idea and architecture behind std-action and decouple it from relying on the std API so that you can just use it with any Nix project. Might do that at some point

OT: I added an issue to consider Forge independence to std-action, cc @David Arnold

view this post on Zulip Andreas (Apr 08 2024 at 16:23):

@Tim DeHerrera I think what keeps me from "re-trying" Helix right now is that i started playing a lot with A.I. these days, and Helix doesn't seem to have a good plugin system yet. Or does it? I don't know if there is a way to plug in my Ollama to Helix.

Bottom line of this so far for me:

But I was under the impression that standard is more for a generalized development setup other than nix itself right? Could I easily integrate these into my system config to drop me into a devShell for nix development proper? I guess I could, but does anyone have an example of something like this?

CI I will have to revisit soon. Then I'll get back here :smile:

view this post on Zulip Arnold Schrijver (Apr 11 2024 at 05:42):

Just found this (rather new) CI/CD engine: https://github.com/fluentci-io/fluentci-engine

FluentCI Engine is a programmable CI/CD engine that is designed to be simple, flexible, and easy to use. It is supposed to run on the host machine without containerization or virtualization, and it is designed to be used with Nix, Pkgx, Devbox, Flox, Devenv, EnvHub, Pixi and Mise.

Also it has a plugin architecture based on WebAssembly (via Extism), and written in Rust.

view this post on Zulip Andreas (Apr 11 2024 at 08:17):

That looks very interesting @Arnold Schrijver

view this post on Zulip Tim DeHerrera (Apr 11 2024 at 15:27):

Yeah, I'll have to dig in and see how (in)efficient the Nix eval code is :joy:

Perhaps I could assist there


Last updated: Nov 13 2024 at 13:02 UTC