aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar@gmail.com>2026-09-15 21:20:56 +0530
committerArpit Chakladar <arpitchakladar@gmail.com>2026-09-15 21:20:56 +0530
commitb5993f4b104ca4defbbbc80bb79ebd96ad18d999 (patch)
treef1f2ef6b673d39b6ba1fa6e526a406061624a1f1 /modules
parent0b525dc347763b13f38eb9f70166e3eec50df2a8 (diff)
downloadhome-manager-config-b5993f4b104ca4defbbbc80bb79ebd96ad18d999.tar.gz
home-manager-config-b5993f4b104ca4defbbbc80bb79ebd96ad18d999.zip
feat(colors/base16): added color for base16 onedark dark
Diffstat (limited to 'modules')
-rw-r--r--modules/colors/base16/onedark-dark.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/modules/colors/base16/onedark-dark.nix b/modules/colors/base16/onedark-dark.nix
new file mode 100644
index 0000000..44c8fce
--- /dev/null
+++ b/modules/colors/base16/onedark-dark.nix
@@ -0,0 +1,63 @@
+# OneDark Dark color scheme
+# Replaces base16.nix with direct string replacement
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+let
+ colors = {
+ base00 = "000000";
+ base01 = "1c1f24";
+ base02 = "2c313a";
+ base03 = "434852";
+ base04 = "565c64";
+ base05 = "abb2bf";
+ base06 = "b6bdca";
+ base07 = "c8ccd4";
+ base08 = "ef596f";
+ base09 = "d19a66";
+ base0A = "e5c07b";
+ base0B = "89ca78";
+ base0C = "2bbac5";
+ base0D = "61afef";
+ base0E = "d55fde";
+ base0F = "be5046";
+ };
+
+ withHashtag = lib.mapAttrs (_: v: "#${v}") colors;
+
+ colorNames = builtins.attrNames colors;
+
+ processTemplate =
+ template:
+ let
+ content = if builtins.typeOf template == "path" then builtins.readFile template else template;
+ replaced = builtins.replaceStrings (map (name: "@@${name}@@") colorNames) (map (
+ name: colors.${name}
+ ) colorNames) content;
+ in
+ replaced;
+in
+{
+ options.colors.onedark-dark = {
+ enable = lib.mkEnableOption "Enables the OneDark Dark color scheme.";
+ };
+
+ options.scheme = lib.mkOption {
+ type = lib.types.unspecified;
+ description = "Color scheme providing withHashtag and template function";
+ };
+
+ config.scheme = lib.mkIf config.colors.onedark-dark.enable {
+ inherit withHashtag;
+ __functor =
+ self:
+ {
+ template,
+ extension ? "",
+ }:
+ pkgs.writeText "themed${extension}" (processTemplate template);
+ };
+}