1
0
Fork 0
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:
awwpotato 2025-04-20 13:20:59 -07:00 committed by GitHub
parent 6a676ee476
commit 642d3e3bad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,7 +90,21 @@ in
}; };
themes = mkOption { 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 = { }; default = { };
example = lib.literalExpression '' example = lib.literalExpression ''
{ {
@ -103,10 +117,6 @@ in
}; };
} }
''; '';
description = ''
See <https://atuin.sh/guide/theming/> for the full list
of options.
'';
}; };
daemon = { daemon = {
@ -152,7 +162,13 @@ in
lib.mapAttrs' ( lib.mapAttrs' (
name: theme: name: theme:
lib.nameValuePair "atuin/themes/${name}.toml" { 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 ) cfg.themes
)) ))