some changes in theme module

This commit is contained in:
Dmitriy Kholkin 2021-09-16 01:03:52 +03:00
parent cbf852ce45
commit 774b465161
22 changed files with 167 additions and 126 deletions

View File

@ -6,6 +6,7 @@
alacritty alacritty
cursor cursor
dunst
fonts fonts
gtk gtk
i3 i3

Binary file not shown.

View File

@ -1,42 +0,0 @@
{ config, lib, pkgs, inputs, ... }: {
config.themes.base16 = with config.deviceSpecific.devInfo; {
enable = true;
# customScheme = {
# enable = true;
# path = "${inputs.base16-horizon-scheme}/horizon-dark.yaml";
# };
scheme = "gruvbox";
variant = "gruvbox-dark-medium";
extraParams = {
# fonts = {
# main = {
# family = "IBM Plex Sans";
# size = 12;
# };
# };
font = "IBM Plex Sans";
fontMono = "IBM Plex Mono";
fontSerif = "IBM Plex Serif";
powerlineFont = "IBM Plex Mono for Powerline";
fallbackFont = "Roboto";
fallbackFontMono = "Roboto Mono";
fallbackFontSerif = "Roboto Slab";
iconFont = "Font Awesome 5 Free";
fallbackIcon = "Material Icons";
iconTheme = "Papirus-Dark";
iconPackage = pkgs.papirus-icon-theme;
normalFontSize = "12";
headerFontSize = "14";
smallFontSize = "11";
microFontSize = "10";
minimalFontSize = "8";
cursorPackage = pkgs.bibata-cursors;
cursorSize = 16;
};
};
}

View File

@ -14,22 +14,22 @@ with config.deviceSpecific;
settings = { settings = {
font = { font = {
normal = { normal = {
family = "${thm.powerlineFont}"; family = "${thm.fonts.powerline.family}";
style = "Regular"; style = "Regular";
}; };
bold = { bold = {
family = "${thm.powerlineFont}"; family = "${thm.fonts.powerline.family}";
style = "Bold"; style = "Bold";
}; };
italic = { italic = {
family = "${thm.powerlineFont}"; family = "${thm.fonts.powerline.family}";
style = "Italic"; style = "Italic";
}; };
bold_italic = { bold_italic = {
family = "${thm.powerlineFont}"; family = "${thm.fonts.powerline.family}";
style = "Bold Italic"; style = "Bold Italic";
}; };
size = lib.toInt thm.smallFontSize; size = thm.fontSizes.small.int;
}; };
window.padding = { window.padding = {

View File

@ -10,7 +10,7 @@ in
home-manager.users.alukard = { home-manager.users.alukard = {
programs.kitty = { programs.kitty = {
enable = config.deviceSpecific.isLaptop; enable = config.deviceSpecific.isLaptop;
font.name = "${thm.powerlineFont} ${thm.smallFontSize}"; font.name = "${thm.fonts.powerline.family} ${thm.fontSizes.small.str}";
# keybindings = '' # keybindings = ''
# ''; # '';
settings = { settings = {

View File

@ -15,6 +15,7 @@ with config.deviceSpecific; {
git-filter-repo git-filter-repo
glib.bin # gio glib.bin # gio
gptfdisk gptfdisk
libqalculate
lm_sensors lm_sensors
lnav lnav
manix manix

View File

@ -12,7 +12,7 @@ in
home-manager.users.alukard = { home-manager.users.alukard = {
programs.rofi = { programs.rofi = {
enable = true; enable = true;
font = "${thm.fontMono} ${thm.headerFontSize}"; font = "${thm.fonts.mono.family} ${thm.fontSizes.header.str}";
terminal = config.defaultApplications.term.cmd; terminal = config.defaultApplications.term.cmd;
theme = "${themeFile}"; theme = "${themeFile}";
}; };

View File

@ -13,10 +13,10 @@ in
programs.urxvt = { programs.urxvt = {
enable = true; enable = true;
extraConfig = { extraConfig = {
"font" = "xft:${thm.powerlineFont}:style=Regular:size=${thm.smallFontSize}"; "font" = "xft:${thm.fonts.powerline.family}:style=Regular:size=${thm.fontSizes.small.str}";
"boldFont" = "xft:${thm.powerlineFont}:style=Bold:size=${thm.smallFontSize}"; "boldFont" = "xft:${thm.fonts.powerline.family}:style=Bold:size=${thm.fontSizes.small.str}";
"italicFont" = "xft:${thm.powerlineFont}:style=Italic:size=${thm.smallFontSize}"; "italicFont" = "xft:${thm.fonts.powerline.family}:style=Italic:size=${thm.fontSizes.small.str}";
"boldItalicfont" = "xft:${thm.powerlineFont}:style=Bold Italic:size=${thm.smallFontSize}"; "boldItalicfont" = "xft:${thm.fonts.powerline.family}:style=Bold Italic:size=${thm.fontSizes.small.str}";
"letterSpace" = "0"; "letterSpace" = "0";
"lineSpace" = "0"; "lineSpace" = "0";

View File

@ -1,9 +1,18 @@
{ lib, pkgs, config, ... }: { { lib, pkgs, config, ... }: {
boot = { boot = {
loader = { loader = {
systemd-boot.enable = lib.mkIf (pkgs.system == "x86_64-linux") true; timeout = lib.mkForce 4;
systemd-boot.enable = pkgs.system == "x86_64-linux";
}; };
kernelParams = [ "quiet" "scsi_mod.use_blk_mq=1" "modeset" "nofb" ]
++ lib.optionals (pkgs.system == "x86_64-linux") [
"rd.systemd.show_status=auto"
"rd.udev.log_priority=3"
"pti=off"
"spectre_v2=off"
];
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = [ "ntfs" ]; supportedFilesystems = [ "ntfs" ];

View File

@ -1,6 +1,5 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with config.deviceSpecific; { with config.deviceSpecific; {
security.apparmor.enable = true; security.apparmor.enable = true;
programs.firejail.enable = true; programs.firejail.enable = true;
users.mutableUsers = false; users.mutableUsers = false;
@ -27,6 +26,7 @@ with config.deviceSpecific; {
"lp" "lp"
"dialout" "dialout"
"corectrl" "corectrl"
"video"
]; ];
description = "Дмитрий Холкин"; description = "Дмитрий Холкин";
uid = 1000; uid = 1000;
@ -45,23 +45,17 @@ with config.deviceSpecific; {
'' else "") '' else "")
]; ];
}; };
# nix.requireSignedBinaryCaches = false; home-manager.users.alukard = {
systemd.user.services.polkit-agent = {
Unit = {
Description = "Run polkit authentication agent";
X-RestartIfChanged = true;
};
Install.WantedBy = [ "sway-session.target" ];
Service = { ExecStart = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1"; };
};
};
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
systemd.services."user@" = { serviceConfig = { Restart = "always"; }; }; systemd.services."user@" = { serviceConfig = { Restart = "always"; }; };
services.getty.autologinUser = "alukard"; services.getty.autologinUser = "alukard";
# auto-login without greeters
# environment.loginShellInit = ''
# [[ "$(tty)" == /dev/tty? ]] && sudo /run/current-system/sw/bin/lock this
# [[ "$(tty)" == /dev/tty1 ]] && i3
# '';
# environment.systemPackages = [
# (pkgs.writeShellScriptBin "lock" ''
# if [[ "$1" == this ]]
# then args="-s"
# else args="-san"
# fi
# USER=alukard ${pkgs.vlock}/bin/vlock "$args"
# '')
# ];
} }

83
profiles/themes.nix Normal file
View File

@ -0,0 +1,83 @@
{ config, lib, pkgs, inputs, ... }: {
config.themes.base16 = with config.deviceSpecific.devInfo; {
enable = true;
# customScheme = {
# enable = true;
# path = "${inputs.base16-horizon-scheme}/horizon-dark.yaml";
# };
scheme = "gruvbox";
variant = "gruvbox-dark-medium";
extraParams = {
fonts = {
main = {
family = "IBM Plex Sans";
size = 12;
};
serif = {
family = "IBM Plex Serif";
size = 12;
};
mono = {
family = "IBM Plex Mono";
size = 12;
};
powerline = {
family = "IBM Plex Mono for Powerline";
size = 12;
};
icon = {
family = "Font Awesome 5 Free";
size = 12;
};
iconFallback = {
family = "Material Icons";
size = 12;
};
};
fontSizes = {
normal = {
str = "12";
int = 12;
float = 12.0;
};
header = {
str = "14";
int = 14;
float = 14.0;
};
small = {
str = "11";
int = 11;
float = 11.0;
};
micro = {
str = "10";
int = 10;
float = 10.0;
};
minimal = {
str = "8";
int = 8;
float = 8.0;
};
};
# font = "IBM Plex Sans";
# fontMono = "IBM Plex Mono";
# fontSerif = "IBM Plex Serif";
# powerlineFont = "IBM Plex Mono for Powerline";
# fallbackFont = "Roboto";
# fallbackFontMono = "Roboto Mono";
# fallbackFontSerif = "Roboto Slab";
# iconFont = "Font Awesome 5 Free";
# fallbackIcon = "Material Icons";
iconTheme = "Papirus-Dark";
iconPackage = pkgs.papirus-icon-theme;
cursorPackage = pkgs.bibata-cursors;
cursorSize = 16;
};
};
}

View File

@ -15,7 +15,7 @@ in {
transparency = 10; transparency = 10;
frame_color = "#${thm.base05-hex}"; frame_color = "#${thm.base05-hex}";
separator_color = "#${thm.base05-hex}"; separator_color = "#${thm.base05-hex}";
font = "${thm.font} ${thm.normalFontSize}"; font = "${thm.fonts.main.family} ${thm.fontSizes.normal.str}";
padding = 15; padding = 15;
horizontal_padding = 17; horizontal_padding = 17;
word_wrap = true; word_wrap = true;

View File

@ -18,9 +18,9 @@ in
fontconfig = { fontconfig = {
enable = lib.mkForce true; enable = lib.mkForce true;
defaultFonts = { defaultFonts = {
monospace = [ "${thm.fontMono} ${thm.normalFontSize}" ]; monospace = [ "${thm.fonts.mono.family} ${thm.fontSizes.normal.str}" ];
sansSerif = [ "${thm.font} ${thm.normalFontSize}" ]; sansSerif = [ "${thm.fonts.main.family} ${thm.fontSizes.normal.str}" ];
serif = [ "${thm.fontSerif} ${thm.normalFontSize}" ]; serif = [ "${thm.fonts.serif.family} ${thm.fontSizes.normal.str}" ];
}; };
}; };
enableDefaultFonts = true; enableDefaultFonts = true;

View File

@ -16,6 +16,7 @@
init = { init = {
defaultBranch = "master"; defaultBranch = "master";
}; };
pull.rebase = true;
}; };
}; };
}; };

View File

@ -45,8 +45,8 @@ in {
package = pkgs.generated-gtk-theme; package = pkgs.generated-gtk-theme;
}; };
font = { font = {
name = "${thm.font}"; name = "${thm.fonts.main.family}";
size = lib.toInt thm.normalFontSize; size = thm.fontSizes.normal.int;
}; };
}; };
home.sessionVariables.XDG_DATA_DIRS = [ home.sessionVariables.XDG_DATA_DIRS = [

View File

@ -20,12 +20,10 @@ in {
{ class = "^Telegram"; } { class = "^Telegram"; }
]; ];
}; };
# fonts = [ "${thm.fontMono} ${thm.microFontSize}" ];
fonts = { fonts = {
names = [ "\"${thm.font}\"" ]; names = [ "${thm.fonts.main.family}" ];
style = "Regular"; style = "Regular";
# size = thm.microFontSize; size = thm.fontSizes.micro.float;
size = 10.0;
}; };
bars = [ ]; bars = [ ];

View File

@ -6,12 +6,10 @@ in {
home-manager.users.alukard = { home-manager.users.alukard = {
xsession.windowManager.i3.config.bars = [{ xsession.windowManager.i3.config.bars = [{
id = "default"; id = "default";
# fonts = [ "${thm.iconFont} Solid ${thm.microFontSize}" "${thm.fallbackIcon} ${thm.microFontSize}" "${thm.powerlineFont} SemiBold ${thm.microFontSize}" ];
fonts = { fonts = {
names = [ "${thm.powerlineFont}" "${thm.iconFont}" "${thm.fallbackIcon}" ]; names = [ "${thm.fonts.powerline.family}" "${thm.fonts.icon.family}" "${thm.fonts.iconFallback.family}" ];
style = "Regular"; style = "Regular";
# size = thm.microFontSize; size = thm.fontSizes.micro.float;
size = 10.0;
}; };
position = "top"; position = "top";
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs"; statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs";

View File

@ -5,7 +5,7 @@ let
writeTextFile { writeTextFile {
inherit name; inherit name;
text = callPackage script { text = callPackage script {
iconfont = c.lib.base16.theme.iconFont; iconfont = c.lib.base16.theme.fonts.icon.family;
config = c; config = c;
}; };
executable = true; executable = true;

View File

@ -106,13 +106,13 @@ with config.lib.base16.theme; {
General = { General = {
ColorScheme = "Generated"; ColorScheme = "Generated";
Name = "Generated"; Name = "Generated";
fixed = "${fontMono},${smallFontSize},-1,5,50,0,0,0,0,0"; fixed = "${fonts.mono.family},${fontSizes.small.str},-1,5,50,0,0,0,0,0";
font = "${font},${smallFontSize},-1,5,50,0,0,0,0,0"; font = "${fonts.main.family},${fontSizes.small.str},-1,5,50,0,0,0,0,0";
menuFont = "${font},${smallFontSize},-1,5,50,0,0,0,0,0"; menuFont = "${fonts.main.family},${fontSizes.small.str},-1,5,50,0,0,0,0,0";
shadeSortColumn = true; shadeSortColumn = true;
smallestReadableFont = smallestReadableFont =
"${font},${minimalFontSize},-1,5,57,0,0,0,0,0,Medium"; "${fonts.main.family},${fontSizes.minimal.str},-1,5,57,0,0,0,0,0,Medium";
toolBarFont = "${font},${smallFontSize},-1,5,50,0,0,0,0,0"; toolBarFont = "${fonts.main.family},${fontSizes.small.str},-1,5,50,0,0,0,0,0";
}; };
KDE = { KDE = {
DoubleClickInterval = 400; DoubleClickInterval = 400;
@ -124,7 +124,7 @@ with config.lib.base16.theme; {
contrast = 4; contrast = 4;
widgetStyle = "Breeze"; widgetStyle = "Breeze";
}; };
Icons = { Theme = "${iconTheme}"; }; Icons = { Theme = "${fonts.icon.family}"; };
}; };
}; };
} }

View File

@ -1,23 +1,22 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }: {
{
programs.light.enable = config.deviceSpecific.isLaptop; programs.light.enable = config.deviceSpecific.isLaptop;
services.actkbd = { services.actkbd = {
enable = config.deviceSpecific.isLaptop; enable = config.deviceSpecific.isLaptop;
bindings = map (x: bindings = map (x:
x // { x // {
events = ["key"]; events = [ "key" ];
attributes = ["exec"]; attributes = [ "exec" ];
}) ([ }) [
{ {
keys = [225]; keys = [ 225 ];
command = "${pkgs.light}/bin/light -A 10"; command = "${pkgs.light}/bin/light -A 10";
} }
{ {
keys = [224]; keys = [ 224 ];
command = "${pkgs.light}/bin/light -U 10"; command = "${pkgs.light}/bin/light -U 10";
} }
{ {
keys = [431]; keys = [ 431 ];
command = (toString (pkgs.writeTextFile { command = (toString (pkgs.writeTextFile {
name = "dark-script"; name = "dark-script";
text = '' text = ''
@ -31,6 +30,6 @@
executable = true; executable = true;
})); }));
} }
]); ];
}; };
} }

View File

@ -11,10 +11,9 @@
services.udiskie.enable = true; services.udiskie.enable = true;
news.display = "silent"; news.display = "silent";
systemd.user.startServices = true; systemd.user.startServices = true;
services.kdeconnect.enable = true; home.stateVersion = "21.11";
}; };
home-manager.users.alukard.home.stateVersion = "21.11";
system.stateVersion = "21.11"; system.stateVersion = "21.11";
systemd.services.systemd-timesyncd.wantedBy = [ "multi-user.target" ]; systemd.services.systemd-timesyncd.wantedBy = [ "multi-user.target" ];

View File

@ -43,8 +43,8 @@ with config.deviceSpecific; {
show-input-cursor = false show-input-cursor = false
password-alignment = right password-alignment = right
[greeter-theme] [greeter-theme]
font = "#${thm.font} Mono" font = "#${thm.fonts.mono.family}"
font-size = 14pt font-size = ${thm.fontSizes.header.str}pt
text-color = "#${thm.base0B-hex}" text-color = "#${thm.base0B-hex}"
error-color = "#${thm.base0B-hex}" error-color = "#${thm.base0B-hex}"
background-image = "" background-image = ""