mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-02 23:21:02 +01:00
atuin: add support for str + path themes (#6849)
This commit is contained in:
parent
6a676ee476
commit
642d3e3bad
1 changed files with 22 additions and 6 deletions
|
|
@ -90,7 +90,21 @@ in
|
|||
};
|
||||
|
||||
themes = mkOption {
|
||||
type = types.attrsOf tomlFormat.type;
|
||||
type = types.attrsOf (
|
||||
types.oneOf [
|
||||
tomlFormat.type
|
||||
types.path
|
||||
types.string
|
||||
]
|
||||
);
|
||||
description = ''
|
||||
Each theme is written to
|
||||
{file}`$XDG_CONFIG_HOME/atuin/themes/theme-name.toml`
|
||||
where the name of each attribute is the theme-name
|
||||
|
||||
See <https://atuin.sh/guide/theming/> for the full list
|
||||
of options.
|
||||
'';
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
|
|
@ -103,10 +117,6 @@ in
|
|||
};
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
See <https://atuin.sh/guide/theming/> for the full list
|
||||
of options.
|
||||
'';
|
||||
};
|
||||
|
||||
daemon = {
|
||||
|
|
@ -152,7 +162,13 @@ in
|
|||
lib.mapAttrs' (
|
||||
name: theme:
|
||||
lib.nameValuePair "atuin/themes/${name}.toml" {
|
||||
source = tomlFormat.generate "atuin-theme-${name}" theme;
|
||||
source =
|
||||
if lib.isString theme then
|
||||
pkgs.writeText "atuin-theme-${name}" theme
|
||||
else if builtins.isPath theme || lib.isStorePath theme then
|
||||
theme
|
||||
else
|
||||
tomlFormat.generate "atuin-theme-${name}" theme;
|
||||
}
|
||||
) cfg.themes
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue