# Alternative language

**URL:** https://discourse.nixos.org/t/alternative-language/5218
**Category:** Uncategorized
**Created:** [December 26, 2019, 11:52am UTC](https://discourse.nixos.org/t/alternative-language/5218 "2019-12-26T11:52:09Z")
**Posts on this page:** 8
**Page:** 2

<div class="post-metadata">

### Author: ![jonringer](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jonringer/32/1348_2.png) [@jonringer](https://discourse.nixos.org/u/jonringer)
#### Post date: [October 22, 2020, 8:39pm UTC](https://discourse.nixos.org/t/alternative-language/5218/21 "2020-10-22T20:39:48Z")

</div>

> [@aszenz](#):
>
> unlike other real languages

Nix-lang is a Domain-Specific-Language. It’s not a general purpose.

> [@aszenz](#):
>
> no documentation on hover, nothing that tells me what arguments this function takes, no goto definition and so on.

Most of the information you’re looking for is probably implemented in nixpkgs, and not in nix-lang. Nix-lang really only offers the core datatypes, keywords and related programming constructs, operators, and items under `builtins`. Everything else is implemented within nixpkgs.

---

<div class="post-metadata">

### Author: ![aszenz](https://discourse.nixos.org/user_avatar/discourse.nixos.org/aszenz/32/3115_2.png) [@aszenz](https://discourse.nixos.org/u/aszenz)
#### Post date: [October 23, 2020, 5:43pm UTC](https://discourse.nixos.org/t/alternative-language/5218/22 "2020-10-23T17:43:07Z")

</div>

I see so you are saying nix lang has no standard way of defining function documentation, module documentation and so. The way I see it is nixpkgs defines many of the library functions that are helpful to build packages in different languages but these are undocumented often and short of reading their usage or source its hard to understand how to use them

---

<div class="post-metadata">

### Author: ![jonringer](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jonringer/32/1348_2.png) [@jonringer](https://discourse.nixos.org/u/jonringer)
#### Post date: [October 23, 2020, 9:30pm UTC](https://discourse.nixos.org/t/alternative-language/5218/23 "2020-10-23T21:30:02Z")

</div>

you will also likely be interested in `nixdoc` package.

As well `nix-doc` [https://www.reddit.com/r/NixOS/comments/i4pnsj/nixdoc\_a\_nix\_function\_documentation\_search\_tool/](https://www.reddit.com/r/NixOS/comments/i4pnsj/nixdoc_a_nix_function_documentation_search_tool/)

---

<div class="post-metadata">

### Author: ![jonringer](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jonringer/32/1348_2.png) [@jonringer](https://discourse.nixos.org/u/jonringer)
#### Post date: [October 23, 2020, 9:38pm UTC](https://discourse.nixos.org/t/alternative-language/5218/24 "2020-10-23T21:38:47Z")

</div>

> [@aszenz](#):
>
> module documentation and so

module documentation is auto generated, if on nixos, you just do `man configuration.nix` for nixos options, `man home-configuration.nix` for home-manager. I’m assuming `nixpkgs-darwin` has something similar.

> [@aszenz](#):
>
> The way I see it is nixpkgs defines many of the library functions that are helpful to build packages in different languages

This is probably me being pedantic. But the `lib` functions, don’t know anything about derivations, they are only helpers around evaluating expressions. “functions that are helpful to build packages in different languages” are usually referred to as `mkDerivation` helpers, and they are usually documented here: [Nixpkgs Reference Manual](https://nixos.org/manual/nixpkgs/stable/#chap-language-support)

> [@aszenz](#):
>
> and short of reading their usage or source its hard to understand how to use them

Agreed, improvement to docs are always welcome 🙂

---

<div class="post-metadata">

### Author: ![aszenz](https://discourse.nixos.org/user_avatar/discourse.nixos.org/aszenz/32/3115_2.png) [@aszenz](https://discourse.nixos.org/u/aszenz)
#### Post date: [October 24, 2020, 4:39am UTC](https://discourse.nixos.org/t/alternative-language/5218/25 "2020-10-24T04:39:43Z")

</div>

Looks quite useful thanks for sharing, greater visibility for the existing docs is nice to have.

---

<div class="post-metadata">

### Author: ![milahu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/milahu/32/4006_2.png) [@milahu](https://discourse.nixos.org/u/milahu)
#### Post date: [November 23, 2021, 5:17pm UTC](https://discourse.nixos.org/t/alternative-language/5218/26 "2021-11-23T17:17:26Z")

</div>

> [@jonringer](#):
>
> There’s a lot of similarities between dhall and nix-lang.

related: [GitHub - tweag/nickel: Better configuration for less](https://github.com/tweag/nickel#related-projects-and-inspirations)

---

<div class="post-metadata">

### Author: ![ShalokShalom](https://discourse.nixos.org/user_avatar/discourse.nixos.org/shalokshalom/32/4108_2.png) [@ShalokShalom](https://discourse.nixos.org/u/ShalokShalom)
#### Post date: [April 15, 2024, 11:17am UTC](https://discourse.nixos.org/t/alternative-language/5218/27 "2024-04-15T11:17:38Z")

</div>

I am excited by the idea of using TOML.

Appearently this has been around for quite some time, but has never really taken off.

There is a [thread](https://discourse.nixos.org/t/having-a-go-at-using-toml-to-configure-nixos/13897) that is also showing an interesting way, how Idris does source TOML files, but there has never been any further comment on it.

I think TOML is far more readable, and could particulary draw in people from Rust, Python and other communities, where it is popular, or even the default choice.

It could remove the long standing issue, of people being scared of Nix as a language.

---

<div class="post-metadata">

### Author: ![Atemu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/atemu/32/10383_2.png) [@Atemu](https://discourse.nixos.org/u/Atemu)
#### Post date: [April 15, 2024, 12:45pm UTC](https://discourse.nixos.org/t/alternative-language/5218/28 "2024-04-15T12:45:46Z")

</div>

You could use TOML already with just a little generic code using the `builtins.fromTOML` function.

This would work fine with any pure value options but not for options that require the use of functions or derivations as neither of those exist in TOML. They’re quite essential for the purposes of NixOS though, so I don’t think you’d get very far with a TOML-only config.

[Previous page](https://discourse.nixos.org/t/alternative-language/5218.md?page=1)
