home, modules: add myFlake.home-manager.colorScheme
This commit is contained in:
parent
b07b91d6b6
commit
65a4e1e46a
11 changed files with 207 additions and 162 deletions
|
@ -0,0 +1,9 @@
|
|||
{lib, ...}: {
|
||||
options.myFlake.home-manager = {
|
||||
colorScheme = lib.mkOption {
|
||||
type = lib.types.enum [null "tokyonight"];
|
||||
default = "tokyonight";
|
||||
description = "Select desired terminal color scheme.";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./terminal.nix
|
||||
./color-scheme.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.home-manager.terminal;
|
||||
in {
|
||||
{lib, ...}: {
|
||||
# 3 terminals, one module.
|
||||
# -- The Orange Box (wtf)
|
||||
|
||||
|
@ -49,36 +42,6 @@ in {
|
|||
example = 8;
|
||||
description = "Select desired terminal padding size (in px).";
|
||||
};
|
||||
|
||||
colorScheme = lib.mkOption {
|
||||
type = lib.types.enum [null "tokyonight"];
|
||||
default = "tokyonight";
|
||||
description = "Select desired terminal color scheme.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config.programs = lib.mkMerge [
|
||||
{
|
||||
alacritty.settings.cursor.style = cfg.cursorStyle;
|
||||
kitty.settings.cursor_shape = cfg.cursorStyle;
|
||||
foot.settings.cursor.style = cfg.cursorStyle;
|
||||
|
||||
alacritty.settings.font.size = cfg.fontSize;
|
||||
kitty.settings.font_size = cfg.fontSize;
|
||||
foot.settings.main.font = "monospace:size=${builtins.toString cfg.fontSize}";
|
||||
|
||||
alacritty.settings.window.padding.x = cfg.padding;
|
||||
alacritty.settings.window.padding.y = cfg.padding;
|
||||
kitty.settings.window_padding_width = builtins.toString (cfg.padding * (3.0 / 4.0)); # px -> pt
|
||||
foot.settings.main.pad = "${builtins.toString cfg.padding}x${builtins.toString cfg.padding}";
|
||||
}
|
||||
|
||||
# TODO: split this part to ./color-scheme.nix (???)
|
||||
(lib.mkIf (cfg.colorScheme == "tokyonight") {
|
||||
alacritty.settings.import = ["${pkgs.vimPlugins.tokyonight-nvim}/extras/alacritty/tokyonight_night.yml"];
|
||||
kitty.settings.include = "${pkgs.vimPlugins.tokyonight-nvim}/extras/kitty/tokyonight_night.conf";
|
||||
foot.settings.main.include = "${pkgs.vimPlugins.tokyonight-nvim}/extras/foot/tokyonight_night.ini";
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
settings = {
|
||||
theme = "tokyonight";
|
||||
theme =
|
||||
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
|
||||
"tokyonight";
|
||||
editor = {
|
||||
cursor-shape = {
|
||||
insert = "bar";
|
||||
|
|
|
@ -1,71 +1,73 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium; # foss
|
||||
enableExtensionUpdateCheck = false;
|
||||
enableUpdateCheck = false;
|
||||
keybindings = [
|
||||
{
|
||||
key = "tab";
|
||||
command = "selectNextSuggestion";
|
||||
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion";
|
||||
}
|
||||
{
|
||||
key = "shift+tab";
|
||||
command = "selectPrevSuggestion";
|
||||
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion";
|
||||
}
|
||||
];
|
||||
userSettings = {
|
||||
diffEditor.ignoreTrimWhitespace = false;
|
||||
editor.cursorBlinking = "smooth";
|
||||
editor.cursorSmoothCaretAnimation = "on";
|
||||
editor.fontFamily = lib.mkDefault "Monospace";
|
||||
editor.fontWeight = 600;
|
||||
editor.smoothScrolling = true;
|
||||
editor.tabSize = 2;
|
||||
explorer.confirmDragAndDrop = false;
|
||||
explorer.confirmDelete = false;
|
||||
files.autoSave = "onFocusChange";
|
||||
files.trimTrailingWhitespace = true;
|
||||
files.trimFinalNewlines = true;
|
||||
security.workspace.trust.enabled = false;
|
||||
telemetry.telemetryLevel = "off";
|
||||
terminal.integrated.cursorStyle = "line";
|
||||
terminal.integrated.smoothScrolling = true;
|
||||
window.menuBarVisibility = "toggle";
|
||||
workbench.colorTheme = "Tokyo Night";
|
||||
workbench.list.smoothScrolling = true;
|
||||
programs.vscode = lib.mkMerge [
|
||||
{
|
||||
enable = true;
|
||||
package = pkgs.vscodium; # foss
|
||||
enableExtensionUpdateCheck = false;
|
||||
enableUpdateCheck = false;
|
||||
keybindings = [
|
||||
{
|
||||
key = "tab";
|
||||
command = "selectNextSuggestion";
|
||||
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion";
|
||||
}
|
||||
{
|
||||
key = "shift+tab";
|
||||
command = "selectPrevSuggestion";
|
||||
when = "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion";
|
||||
}
|
||||
];
|
||||
userSettings = {
|
||||
diffEditor.ignoreTrimWhitespace = false;
|
||||
editor.cursorBlinking = "smooth";
|
||||
editor.cursorSmoothCaretAnimation = "on";
|
||||
editor.fontFamily = lib.mkDefault "Monospace";
|
||||
editor.fontWeight = 600;
|
||||
editor.smoothScrolling = true;
|
||||
editor.tabSize = 2;
|
||||
explorer.confirmDragAndDrop = false;
|
||||
explorer.confirmDelete = false;
|
||||
files.autoSave = "onFocusChange";
|
||||
files.trimTrailingWhitespace = true;
|
||||
files.trimFinalNewlines = true;
|
||||
security.workspace.trust.enabled = false;
|
||||
telemetry.telemetryLevel = "off";
|
||||
terminal.integrated.cursorStyle = "line";
|
||||
terminal.integrated.smoothScrolling = true;
|
||||
window.menuBarVisibility = "toggle";
|
||||
workbench.list.smoothScrolling = true;
|
||||
|
||||
# Workaround for VSCode crashing
|
||||
# https://github.com/microsoft/vscode/issues/184124
|
||||
window.titleBarStyle = "custom";
|
||||
workbench.layoutControl.enabled = false;
|
||||
window.commandCenter = false;
|
||||
# Workaround for VSCode crashing
|
||||
# https://github.com/microsoft/vscode/issues/184124
|
||||
window.titleBarStyle = "custom";
|
||||
workbench.layoutControl.enabled = false;
|
||||
window.commandCenter = false;
|
||||
|
||||
# Language specific
|
||||
### Nix
|
||||
"[nix]".editor.tabSize = 2;
|
||||
# Language specific
|
||||
### Nix
|
||||
"[nix]".editor.tabSize = 2;
|
||||
|
||||
# Extensions
|
||||
### GitLens
|
||||
gitlens.telemetry.enabled = false;
|
||||
};
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
### QoL
|
||||
eamodio.gitlens
|
||||
esbenp.prettier-vscode
|
||||
ritwickdey.liveserver
|
||||
vscodevim.vim
|
||||
# Extensions
|
||||
### GitLens
|
||||
gitlens.telemetry.enabled = false;
|
||||
};
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
### QoL
|
||||
eamodio.gitlens
|
||||
esbenp.prettier-vscode
|
||||
ritwickdey.liveserver
|
||||
vscodevim.vim
|
||||
];
|
||||
}
|
||||
|
||||
### Themes
|
||||
enkia.tokyo-night
|
||||
#catppuccin.catppuccin-vsc-icons
|
||||
#catppuccin.catppuccin-vsc
|
||||
];
|
||||
};
|
||||
(lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight") {
|
||||
extensions = [pkgs.vscode-extensions.enkia.tokyo-night];
|
||||
userSettings.workbench.colorTheme = "Tokyo Night";
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting
|
||||
source ${pkgs.vimPlugins.tokyonight-nvim}/extras/fish/tokyonight_night.fish
|
||||
${lib.strings.optionalString (config.myFlake.home-manager.colorScheme == "tokyonight")
|
||||
"source ${pkgs.vimPlugins.tokyonight-nvim}/extras/fish/tokyonight_night.fish"}
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
|
|
|
@ -1,6 +1,23 @@
|
|||
{...}: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.home-manager.terminal;
|
||||
in {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
#settings.env.WINIT_X11_SCALE_FACTOR = "1"; # workaround for.. something?
|
||||
settings = {
|
||||
import =
|
||||
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
|
||||
["${pkgs.vimPlugins.tokyonight-nvim}/extras/alacritty/tokyonight_night.yml"];
|
||||
cursor.style = cfg.cursorStyle;
|
||||
font.size = cfg.fontSize;
|
||||
window.padding.x = cfg.padding;
|
||||
window.padding.y = cfg.padding;
|
||||
|
||||
#env.WINIT_X11_SCALE_FACTOR = "1"; # workaround for.. something?
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,20 @@
|
|||
{...}: {
|
||||
programs.foot = {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.foot = let
|
||||
cfg = config.myFlake.home-manager.terminal;
|
||||
in {
|
||||
enable = true;
|
||||
settings = {
|
||||
main.include =
|
||||
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
|
||||
"${pkgs.vimPlugins.tokyonight-nvim}/extras/foot/tokyonight_night.ini";
|
||||
cursor.style = cfg.cursorStyle;
|
||||
main.font = "monospace:size=${builtins.toString cfg.fontSize}";
|
||||
main.pad = "${builtins.toString cfg.padding}x${builtins.toString cfg.padding}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
{...}: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.home-manager.terminal;
|
||||
in {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
settings.confirm_os_window_close = 0;
|
||||
settings = {
|
||||
include =
|
||||
lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight")
|
||||
"${pkgs.vimPlugins.tokyonight-nvim}/extras/kitty/tokyonight_night.conf";
|
||||
cursor_shape = cfg.cursorStyle;
|
||||
font_size = cfg.fontSize;
|
||||
window_padding_width = builtins.toString (cfg.padding * (3.0 / 4.0)); # px -> pt
|
||||
|
||||
confirm_os_window_close = 0;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,27 +1,33 @@
|
|||
{...}: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
services.dunst = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
padding = 10;
|
||||
horizontal_padding = 10;
|
||||
frame_width = 2;
|
||||
font = "Monospace 10";
|
||||
icon_path = "/home/guanranwang/.local/share/icons/dunst";
|
||||
corner_radius = 10;
|
||||
settings = lib.mkMerge [
|
||||
{
|
||||
global = {
|
||||
padding = 10;
|
||||
horizontal_padding = 10;
|
||||
frame_width = 2;
|
||||
font = "Monospace 10";
|
||||
icon_path = "/home/guanranwang/.local/share/icons/dunst";
|
||||
corner_radius = 10;
|
||||
|
||||
max_icon_size = 128; # weird bug, default value (128) not working
|
||||
};
|
||||
|
||||
# Tokyonight
|
||||
global = {
|
||||
frame_color = "#c0caf5";
|
||||
background = "#1a1b26";
|
||||
foreground = "#c0caf5";
|
||||
};
|
||||
|
||||
urgency_critical.frame_color = "#fab387";
|
||||
};
|
||||
max_icon_size = 128; # weird bug, default value (128) not working
|
||||
};
|
||||
}
|
||||
(lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight") {
|
||||
# Tokyonight
|
||||
global = {
|
||||
frame_color = "#c0caf5";
|
||||
background = "#1a1b26";
|
||||
foreground = "#c0caf5";
|
||||
};
|
||||
urgency_critical.frame_color = "#fab387";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
xdg.dataFile."icons/dunst" = {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
gtk.enable = true;
|
||||
|
@ -65,39 +66,42 @@
|
|||
};
|
||||
|
||||
# Misc
|
||||
xresources.properties = {
|
||||
# Cursor
|
||||
"Xcursor.theme" = "Adwaita";
|
||||
xresources.properties = lib.mkMerge [
|
||||
{
|
||||
# Cursor
|
||||
"Xcursor.theme" = "Adwaita";
|
||||
|
||||
# Fonts
|
||||
"Xft.autohint" = "0";
|
||||
"Xft.lcdfilter" = "lcddefault";
|
||||
"Xft.hintstyle" = "hintslight";
|
||||
"Xft.hinting" = "1";
|
||||
"Xft.antialias" = "1";
|
||||
"Xft.rgba" = "rgb";
|
||||
# Fonts
|
||||
"Xft.autohint" = "0";
|
||||
"Xft.lcdfilter" = "lcddefault";
|
||||
"Xft.hintstyle" = "hintslight";
|
||||
"Xft.hinting" = "1";
|
||||
"Xft.antialias" = "1";
|
||||
"Xft.rgba" = "rgb";
|
||||
}
|
||||
(lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight") {
|
||||
# Tokyonight color scheme
|
||||
# i have no idea what does it apply to
|
||||
"*background" = "#1a1b26";
|
||||
"*foreground" = "#c0caf5";
|
||||
|
||||
# Tokyonight color scheme
|
||||
# i have no idea what does it apply to
|
||||
"*background" = "#1a1b26";
|
||||
"*foreground" = "#c0caf5";
|
||||
"*color0" = "#15161e";
|
||||
"*color1" = "#f7768e";
|
||||
"*color2" = "#9ece6a";
|
||||
"*color3" = "#e0af68";
|
||||
"*color4" = "#7aa2f7";
|
||||
"*color5" = "#bb9af7";
|
||||
"*color6" = "#7dcfff";
|
||||
"*color7" = "#a9b1d6";
|
||||
|
||||
"*color0" = "#15161e";
|
||||
"*color1" = "#f7768e";
|
||||
"*color2" = "#9ece6a";
|
||||
"*color3" = "#e0af68";
|
||||
"*color4" = "#7aa2f7";
|
||||
"*color5" = "#bb9af7";
|
||||
"*color6" = "#7dcfff";
|
||||
"*color7" = "#a9b1d6";
|
||||
|
||||
"*color8" = "#414868";
|
||||
"*color9" = "#f7768e";
|
||||
"*color10" = "#9ece6a";
|
||||
"*color11" = "#e0af68";
|
||||
"*color12" = "#7aa2f7";
|
||||
"*color13" = "#bb9af7";
|
||||
"*color14" = "#7dcfff";
|
||||
"*color15" = "#c0caf5";
|
||||
};
|
||||
"*color8" = "#414868";
|
||||
"*color9" = "#f7768e";
|
||||
"*color10" = "#9ece6a";
|
||||
"*color11" = "#e0af68";
|
||||
"*color12" = "#7aa2f7";
|
||||
"*color13" = "#bb9af7";
|
||||
"*color14" = "#7dcfff";
|
||||
"*color15" = "#c0caf5";
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue