4 ms·
If the problem is the syntax and people wants some other format that compiles to nix, there's dhall https://dhall-lang.org/ https://dhall-lang.org/ https://gi
by nextaccountic 5y ago
If the problem is the syntax and people wants some other format that compiles to nix, there's dhall
https://dhall-lang.org/ https://dhall-lang.org/
https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nix https://github.com/dhall-lang/dhall-haskell/tree/master/dhal...
https://www.haskellforall.com/2017/01/typed-nix-programming-using-dhall.html https://www.haskellforall.com/2017/01/typed-nix-programming-...
Dhall is a generic config language with some programming capabilities (but not turing complete) that can compile to json, yaml, and other formats, like in this instance nix.
- viraptor 5y agoIt's not just the syntax (for me anyway). I just don't care about the how the derivation composes in practice, how it does overrides, how it integrates with flakes, how it applies the best-practices-of-the-day. I see the derivation as pure function as a cool theoretical exercise - but not something I want to actually write. I want to actually declaratively say: here's an autotools package with some parameters I defined, give me the fancy overridable pure nix equivalent.
- flurie 5y agoIt sounds like https://github.com/jonringer/nix-template https://github.com/jonringer/nix-template might be helpful to you. You can generate a nix expression to build an autotools package, and you can even pull the package info straight from a public repo. In the case of nix, most C-type things fall under stdenv, so that is the template you would want to use. I barely write any C, but I've gotten very good at building C/C++ applications over the past couple of weeks by fixing broken derivations ahead of a release.
- viraptor 5y agoThat does look really cool and useful, thank you!
- johnisgood 5y agoIs Dhall worth it? I see there are Go bindings for it, but I am not sure. Is it really worth it? What is the use-case for it where TOML would not suffice?
- nextaccountic 5y agoI keep thinking about using it, but I've never used it, so I wouldn't actually know.. But, the use case is to reduce redundancy in the config file. Maybe when you have lots of configs, each with slightly different fields but the rest otherwise the same. Toml isn't really suitable for programmatically generating config like that.