I propose "Nis", a new syntax for Nix.
Nix's syntax has a couple of issues. Its function invocation syntax breaks in arrays, which is fairly serious. It also involves a lot of semicolons. Neither of these things are necessary.
Nix version:
{
outputs = inputs: let
username = "mako";
defaultHostname = "yoga";
forHost = hostname: numberOfPears: moreConfig:
inputs.nixpkgs.lib.nixosSystem {
modules = [
moreConfig
(import ./harware-configuration.nix)
{
fruitBowl = { pears = numberOfPears; };
inherit username;
inherit hostname;
}
];
};
in {
nixosConfigurations = {
yoga = forHost defaultHostname (4 + 2)*3 {};
};
}
Nis version:
{
outputs = (inputs): let
username = "mako"
defaultHostname = "yoga"
forHost = (hostname numberOfPears moreConfig):
inputs.nixpkgs.lib.nixosSystem({
modules = [
moreConfig
import(./harware-configuration.nix)
{
fruitBowl = { pears = numberOfPears }
inherit username
inherit hostname
}
]
})
in {
nixosConfigurations = forHost(defaultHostname (4 + 2)*3 {})
}
}
Those are the benefits. The only drawback is a potential to leave programmers a more confused when they first encounter a function that returns a function being used as if it were a function of two parameters, as a result of not having forceably introduced to the curried function signature syntax in the process of learning the syntax, but I was already pretty confused when I encountered an immediate call into a returned function, so I'm not sure how much difference this will make.
The parser's a little bit more complex, but you only have to write it once, and I might be the one who does it, and I don't mind doing it.
Whether a nix code file uses the nis or nix syntax can generally be determined from the file extension of the import. import
will be easy to adapt.