feat(nvim-hm): set gtk theme via nix home manager

This commit is contained in:
Price Hiller 2023-11-30 23:46:05 -06:00
parent cd225b69bb
commit cc00e11a8d
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
5 changed files with 98 additions and 38 deletions

View File

@ -12,10 +12,10 @@ let
})
# HACK: We don't use the absolute path in readDir to respect pure evaluation in nix flakes.
(builtins.attrNames (builtins.readDir ../dots/${dir}))));
gtkStyle = "gtk2";
in
{
programs.home-manager.enable = true;
home = {
packages = with pkgs; [
gcc
@ -56,7 +56,16 @@ in
ripgrep
fd
nixfmt
qt6Packages.qt6gtk2
qt6Packages.qt6ct
libsForQt5.qtstyleplugins
libsForQt5.qt5ct
lxappearance
webcord
blueman
gtk-engine-murrine
];
file =
{
".local/" = {
@ -77,12 +86,65 @@ in
force = true;
};
} // softLinkDots ".config";
sessionVariables = {
GTK_THEME = "Kanagawa-Borderless";
QT_QPA_PLATFORMTHEME = "${gtkStyle}";
};
};
programs.neovim = {
enable = true;
extraPackages = with pkgs; [ sqlite gh ];
# Magick is required for image.nvim
extraLuaPackages = lp: [ lp.magick ];
programs = {
zsh = {
enable = true;
initExtra = ''
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
'';
profileExtra = ''
export GTK_PATH="$HOME/.nix-profile/lib/gtk-2.0"
'';
};
neovim = {
enable = true;
extraPackages = with pkgs; [ sqlite gh ];
# Magick is required for image.nvim
extraLuaPackages = lp: [ lp.magick ];
};
};
gtk =
let
extraGtkConfig = {
gtk-application-prefer-dark-theme = true;
gtk-cursor-theme-size = 0;
gtk-enable-event-sounds = 1;
gtk-enable-input-feedback-sounds = 1;
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintfull";
};
in
{
enable = true;
theme = {
name = "Kanagawa-Borderless";
package = pkgs.kanagawa-gtk-theme;
};
iconTheme = {
name = "Kanagawa";
package = pkgs.kanagawa-gtk-theme;
};
font = {
name = "Open Sans";
size = 11;
package = pkgs.open-sans;
};
gtk3.extraConfig = extraGtkConfig;
gtk4.extraConfig = extraGtkConfig;
};
qt = {
enable = true;
platformTheme = "gtk";
};
}

View File

@ -1,16 +0,0 @@
[Settings]
gtk-icon-theme-name=Kanagawa
gtk-theme-name=Kanagawa-Borderless
gtk-font-name=Open Sans 11
gtk-application-prefer-dark-theme=0
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull

View File

@ -1,16 +0,0 @@
[Settings]
gtk-icon-theme-name=Kanagawa
gtk-theme-name=Kanagawa-Borderless
gtk-font-name=Open Sans 11
gtk-application-prefer-dark-theme=0
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull

View File

@ -24,6 +24,7 @@
({
nixpkgs.overlays = [
inputs.neovim-nightly-overlay.overlay
(self: super: { kanagawa-gtk-theme = super.callPackage ./pkgs/kanagawa-gtk { }; })
];
home = {
username = "${username}";

View File

@ -0,0 +1,29 @@
{ lib, stdenvNoCC, fetchFromGitHub, gnome-themes-extra, gtk-engine-murrine }:
stdenvNoCC.mkDerivation {
pname = "kanagawa-gtk-theme";
version = "unstable-2023-11-30";
src = fetchFromGitHub {
owner = "Fausto-Korpsvart";
repo = "Kanagawa-GKT-Theme";
rev = "35936a1e3bbd329339991b29725fc1f67f192c1e";
hash = "sha256-BZRmjVas8q6zsYbXFk4bCk5Ec/3liy9PQ8fqFGHAXe0=";
};
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
buildInputs = [ gnome-themes-extra ];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/share/themes/{Kanagawa-Border,Kanagawa-Borderless}
mkdir -p $out/share/icons
cp -r icons/Kanagawa $out/share/icons
cp -r themes/Kanagawa-B/* $out/share/themes/Kanagawa-Border
cp -r themes/Kanagawa-BL/* $out/share/themes/Kanagawa-Borderless
runHook postInstall
'';
}