feat: configure theme globally

main
mandlm 2022-08-18 21:15:03 +02:00
parent a2cff9b42c
commit 07484604d4
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7
7 changed files with 32 additions and 21 deletions

View File

@ -11,6 +11,7 @@
outputs = inputs @ { self, nixpkgs, home-manager, ... }: outputs = inputs @ { self, nixpkgs, home-manager, ... }:
let let
user = "mandlm"; user = "mandlm";
theme = "dark"; # dark or light
in in
{ {
nixosConfigurations = { nixosConfigurations = {
@ -27,7 +28,7 @@
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user nixpkgs; }; home-manager.extraSpecialArgs = { inherit user theme; };
home-manager.users.${user} = { home-manager.users.${user} = {
imports = [ ./home-${user}.nix ]; imports = [ ./home-${user}.nix ];
}; };
@ -48,7 +49,7 @@
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; }; home-manager.extraSpecialArgs = { inherit user theme; };
home-manager.users.${user} = { home-manager.users.${user} = {
imports = [ imports = [
./home-${user}.nix ./home-${user}.nix
@ -72,7 +73,7 @@
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; }; home-manager.extraSpecialArgs = { inherit user theme; };
home-manager.users.${user} = { home-manager.users.${user} = {
imports = [ imports = [
./home-${user}.nix ./home-${user}.nix

View File

@ -1,10 +1,13 @@
{ config, lib, pkgs, user, ... }: { config, lib, pkgs, theme, ... }:
let
theme_name = "Solarized (${theme})";
in
{ {
programs = { programs = {
bat = { bat = {
enable = true; enable = true;
config.theme = "Solarized (dark)"; config.theme = theme_name;
}; };
}; };
} }

View File

@ -1,10 +1,13 @@
{ config, lib, pkgs, user, ... }: { config, lib, pkgs, user, theme, ... }:
let
theme_name = if theme == "light" then "Solarized Light" else "Solarized Dark";
in
{ {
programs = { programs = {
kitty = { kitty = {
enable = true; enable = true;
theme = "Solarized Dark"; theme = theme_name;
font = { font = {
name = "DejaVu Sans Mono"; name = "DejaVu Sans Mono";
}; };

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, user, ... }: { config, lib, pkgs, user, theme, ... }:
let let
cmp-nvim-lsp-signature-help = pkgs.vimUtils.buildVimPlugin { cmp-nvim-lsp-signature-help = pkgs.vimUtils.buildVimPlugin {
@ -141,7 +141,10 @@ in
${builtins.readFile ./luasnip.lua } ${builtins.readFile ./luasnip.lua }
${builtins.readFile ./nvim-cmp.lua } ${builtins.readFile ./nvim-cmp.lua }
${builtins.readFile ./telescope.lua } ${builtins.readFile ./telescope.lua }
${builtins.readFile ./themes.lua } ${builtins.readFile ./themes.lua }
vim.opt.background = '${theme}'
${builtins.readFile ./project-nvim.lua } ${builtins.readFile ./project-nvim.lua }
EOF EOF
''; '';

View File

@ -1,2 +1 @@
vim.opt.background = 'dark'
vim.cmd("colorscheme solarized") vim.cmd("colorscheme solarized")

View File

@ -1,5 +1,7 @@
{ config, lib, pkgs, user, ... }: { config, lib, pkgs, user, theme, ... }:
let
zsh_autosuggest_highlight_style = if theme == "light" then "fg=180" else "fg=10";
in
{ {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -8,7 +10,7 @@
history.size = 10000; history.size = 10000;
sessionVariables = { sessionVariables = {
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=10"; ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = zsh_autosuggest_highlight_style;
}; };
shellAliases = { shellAliases = {

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, user, ... }: { config, lib, pkgs, user, theme, ... }:
{ {
home = { home = {
@ -36,14 +36,14 @@
programs.home-manager.enable = true; programs.home-manager.enable = true;
imports = [ imports = [
home-manager/fzf.nix ./home-manager/fzf.nix
home-manager/git.nix ./home-manager/git.nix
home-manager/kitty.nix ./home-manager/kitty.nix
home-manager/neovim ./home-manager/neovim
home-manager/gpg ./home-manager/gpg
home-manager/zsh.nix ./home-manager/zsh.nix
home-manager/starship.nix ./home-manager/starship.nix
home-manager/i3 ./home-manager/i3
./home-manager/rofi.nix ./home-manager/rofi.nix
./home-manager/direnv.nix ./home-manager/direnv.nix
./home-manager/bat.nix ./home-manager/bat.nix