-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for styling nixvim (#194)
Closes #153 Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com> Co-authored-by: Daniel Thwaites <danthwaites30@btinternet.com>
- Loading branch information
1 parent
41d2185
commit d14ac49
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import ./nixvim.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import ./nixvim.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import ./nixvim.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
config, | ||
lib, | ||
options, | ||
... | ||
}: { | ||
options.stylix.targets.nixvim = { | ||
enable = | ||
config.lib.stylix.mkEnableTarget "nixvim" (config.programs ? nixvim); | ||
transparent_bg = { | ||
main = lib.mkEnableOption "background transparency for the main NeoVim window"; | ||
sign_column = lib.mkEnableOption "background transparency for the NeoVim sign column"; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf ((config.programs ? nixvim) && config.stylix.targets.nixvim.enable) ( | ||
lib.optionalAttrs (builtins.hasAttr "nixvim" options.programs) { | ||
programs.nixvim = { | ||
colorschemes.base16 = { | ||
customColorScheme = let | ||
colors = config.lib.stylix.colors.withHashtag; | ||
in { | ||
base00 = colors.base00; | ||
base01 = colors.base01; | ||
base02 = colors.base02; | ||
base03 = colors.base03; | ||
base04 = colors.base04; | ||
base05 = colors.base05; | ||
base06 = colors.base06; | ||
base07 = colors.base07; | ||
base08 = colors.base08; | ||
base09 = colors.base09; | ||
base0A = colors.base0A; | ||
base0B = colors.base0B; | ||
base0C = colors.base0C; | ||
base0D = colors.base0D; | ||
base0E = colors.base0E; | ||
base0F = colors.base0F; | ||
}; | ||
|
||
enable = true; | ||
}; | ||
|
||
highlight = let | ||
cfg = config.stylix.targets.nixvim; | ||
transparent = { | ||
bg = "none"; | ||
ctermbg = "none"; | ||
}; | ||
in { | ||
Normal = lib.mkIf cfg.transparent_bg.main transparent; | ||
NonText = lib.mkIf cfg.transparent_bg.main transparent; | ||
SignColumn = lib.mkIf cfg.transparent_bg.sign_column transparent; | ||
}; | ||
}; | ||
} | ||
); | ||
} |