feat: configure theme globally

This commit is contained in:
Michael Mandl 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, ... }:
let
user = "mandlm";
theme = "dark"; # dark or light
in
{
nixosConfigurations = {
@ -27,7 +28,7 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user nixpkgs; };
home-manager.extraSpecialArgs = { inherit user theme; };
home-manager.users.${user} = {
imports = [ ./home-${user}.nix ];
};
@ -48,7 +49,7 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; };
home-manager.extraSpecialArgs = { inherit user theme; };
home-manager.users.${user} = {
imports = [
./home-${user}.nix
@ -72,7 +73,7 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; };
home-manager.extraSpecialArgs = { inherit user theme; };
home-manager.users.${user} = {
imports = [
./home-${user}.nix

View file

@ -1,10 +1,13 @@
{ config, lib, pkgs, user, ... }:
{ config, lib, pkgs, theme, ... }:
let
theme_name = "Solarized (${theme})";
in
{
programs = {
bat = {
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 = {
kitty = {
enable = true;
theme = "Solarized Dark";
theme = theme_name;
font = {
name = "DejaVu Sans Mono";
};

View file

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

View file

@ -1,2 +1 @@
vim.opt.background = 'dark'
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 = {
enable = true;
@ -8,7 +10,7 @@
history.size = 10000;
sessionVariables = {
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=10";
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = zsh_autosuggest_highlight_style;
};
shellAliases = {

View file

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