1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-09-16 19:37:31 +02:00

starship: fix type of settings to allow all valid value

Previously, type check of `programs.starship.settings` fails for some
valid settings, such as `c.commands = [["cc" "--version"]]`.

The commit fix the `type` argument passed to `mkOption`, so
`programs.starship.settings` can accept all valid values (of toml
type).
This commit is contained in:
Bojun Ren 2024-07-07 02:08:39 +08:00 committed by GitHub
parent e3582e5151
commit 10486e6b31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,14 +24,7 @@ in {
};
settings = mkOption {
type = with types;
let
prim = either bool (either int str);
primOrPrimAttrs = either prim (attrsOf prim);
entry = either prim (listOf primOrPrimAttrs);
entryOrAttrsOf = t: either entry (attrsOf t);
entries = entryOrAttrsOf (entryOrAttrsOf entry);
in attrsOf entries // { description = "Starship configuration"; };
type = tomlFormat.type;
default = { };
example = literalExpression ''
{