1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-14 13:01:09 +01:00

starship: give settings option more specific type

This more readily allows merging configurations.

Fixes #1023
This commit is contained in:
Robert Helgesson 2020-02-29 22:17:47 +01:00
parent 2f726bbd1c
commit acf106ced0
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
5 changed files with 94 additions and 1 deletions

View file

@ -31,8 +31,23 @@ in {
};
settings = mkOption {
type = types.attrs;
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"; };
default = { };
example = literalExample ''
{
add_newline = false;
prompt_order = [ "line_break" "package" "line_break" "character" ];
scan_timeout = 10;
character.symbol = "";
}
'';
description = ''
Configuration written to
<filename>~/.config/starship.toml</filename>.