Update flake, theme gtk, add vscode cache

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-06-25 11:10:32 +03:00
parent bedf27aa5f
commit 193c665aa4
11 changed files with 160 additions and 297 deletions

View File

@@ -1,10 +1,50 @@
{ user ? throw "user argument is required" }: { config, ... }:
{ user ? throw "user argument is required" }: { config, pkgs, ... }:
let
hmConfig = config.home-manager.users."${user.name}";
in
{
home-manager.users."${user.name}" = {
gtk.gtk2.configLocation = "${hmConfig.xdg.configHome}/gtk-2.0/gtkrc";
gtk = {
enable = true;
theme = {
package = pkgs.adw-gtk3;
name = "adw-gtk3-dark";
};
gtk2.configLocation = "${hmConfig.xdg.configHome}/gtk-2.0/gtkrc";
gtk3.extraCss = "@import './theme.css';";
gtk4.extraCss = "@import './theme.css';";
};
programs.matugen.settings.templates = {
gtk3 = {
input_path = ./theme.css;
output_path = "${hmConfig.xdg.configHome}/gtk-3.0/theme.css";
};
gtk4 = {
input_path = ./theme.css;
output_path = "${hmConfig.xdg.configHome}/gtk-4.0/theme.css";
};
};
theme.extraConfig = let name = "theme-gtk"; in
"${pkgs.writeShellApplication {
inherit name;
runtimeInputs = with pkgs; [ glib ];
text = ''
MODE=$(cat "${hmConfig.theme.configDir}/mode")
if [ "$MODE" = "light" ]; then
GTK_THEME="adw-gtk3"
else
GTK_THEME="adw-gtk3-dark"
fi
gsettings set org.gnome.desktop.interface gtk-theme "$GTK_THEME"
gsettings set org.gnome.desktop.interface color-scheme "prefer-$MODE"
'';
}}/bin/${name} &";
};
}