From 158a74e00d736104f515b1470b6ac3d8b459d60c Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 11 Apr 2023 13:57:47 +0300 Subject: [PATCH] dev(theme): disable transparency support by default --- modules/theme/config.nix | 1 + modules/theme/supported_themes.nix | 9 ++++++--- modules/theme/theme.nix | 8 +++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/theme/config.nix b/modules/theme/config.nix index 3338643..450821a 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 2207146..c0ebfcf 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 16a2713..06a5dd5 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";