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.
This is something we want to document in the larger theme of https://nixos.asia/en/dev
For now, you want to:
nil
(nil_ls.enable = true;
in nixvim config)@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!
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.
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
Do you guys @Srid and @Tim DeHerrera have some readily available actionable example flakes you could point me to that you are using?
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
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
@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:
nil
and use direnv
more widely than I do so far. nixago
and standard
now after David introduced them to me a while ago. 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:
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.
That looks very interesting @Arnold Schrijver
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