Skip to content

Commit

Permalink
starship: fix type of settings to allow all valid value
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
rennsax authored Jul 6, 2024
1 parent e3582e5 commit 10486e6
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions modules/programs/starship.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
{
Expand Down

0 comments on commit 10486e6

Please sign in to comment.