diff --git a/modules/theme/config.nix b/modules/theme/config.nix index 33386438..450821a3 100644 --- a/modules/theme/config.nix +++ b/modules/theme/config.nix @@ -9,6 +9,7 @@ with lib; { enable = mkDefault false; name = mkDefault "onedark"; style = mkDefault "darker"; + transparent = mkDefault false; extraConfig = mkDefault ""; }; }; diff --git a/modules/theme/supported_themes.nix b/modules/theme/supported_themes.nix index 22071469..c0ebfcff 100644 --- a/modules/theme/supported_themes.nix +++ b/modules/theme/supported_themes.nix @@ -1,4 +1,4 @@ -{ +{lib}: { onedark = { setup = {style ? "dark"}: '' -- OneDark theme @@ -20,11 +20,14 @@ }; catppuccin = { - setup = {style ? "mocha"}: '' + setup = { + style ? "mocha", + transparent ? false, + }: '' -- Catppuccin theme require('catppuccin').setup { flavour = "${style}", - transparent_background = true, + transparent_background = "${builtins.toString transparent}", integrations = { nvimtree = { enabled = true, diff --git a/modules/theme/theme.nix b/modules/theme/theme.nix index 16a27132..06a5dd5f 100644 --- a/modules/theme/theme.nix +++ b/modules/theme/theme.nix @@ -7,7 +7,7 @@ with lib; with lib.attrsets; with builtins; let cfg = config.vim.theme; - supported_themes = import ./supported_themes.nix; + supported_themes = import ./supported_themes.nix {inherit lib;}; in { options.vim.theme = { enable = mkOption { @@ -25,6 +25,12 @@ in { description = "Specific style for theme if it supports it"; }; + transparent = mkOption { + type = with types; bool; + default = false; + description = "Whether or not transparency should be enabled. Has no effect for themes that do not support transparency"; + }; + extraConfig = mkOption { type = with types; lines; description = "Additional lua configuration to add before setup";