From 642d3e3bad75f688fa68edc01f2c3c8fe9833737 Mon Sep 17 00:00:00 2001
From: awwpotato <153149335+awwpotato@users.noreply.github.com>
Date: Sun, 20 Apr 2025 13:20:59 -0700
Subject: [PATCH] atuin: add support for str + path themes (#6849)
---
modules/programs/atuin.nix | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix
index 73717f116..2dc2b524e 100644
--- a/modules/programs/atuin.nix
+++ b/modules/programs/atuin.nix
@@ -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 for the full list
+ of options.
+ '';
default = { };
example = lib.literalExpression ''
{
@@ -103,10 +117,6 @@ in
};
}
'';
- description = ''
- See 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
))