69 lines
1.9 KiB
Nix
Raw Normal View History

2019-09-11 17:17:56 +04:00
{ pkgs, config, lib, ... }:
let
thm = config.themes.colors;
thm' = builtins.mapAttrs (name: value: builtins.substring 1 7 value) thm;
materia_colors = pkgs.writeTextFile {
name = "gtk-generated-colors";
text = ''
BG=${thm'.bg}
FG=${thm'.fg}
BTN_BG=${thm'.bg}
BTN_FG=${thm'.fg}
MENU_BG=${thm'.bg}
MENU_FG=${thm'.fg}
ACCENT_BG=${thm'.blue}
SEL_BG=${thm'.blue}
SEL_FG=${thm'.bg}
TXT_BG=${thm'.bg}
TXT_FG=${thm'.fg}
HDR_BTN_BG=${thm'.bg}
HDR_BTN_FG=${thm'.fg}
WM_BORDER_FOCUS=${thm'.blue}
WM_BORDER_UNFOCUS=${thm'.alt}
MATERIA_STYLE_COMPACT=True
MATERIA_COLOR_VARIANT=dark
UNITY_DEFAULT_LAUNCHER_STYLE=False
NAME=generated
'';
};
in {
nixpkgs.overlays = [(self: super: {
generated-gtk-theme = self.stdenv.mkDerivation rec {
name = "generated-gtk-theme";
2020-02-05 04:30:49 +04:00
src = pkgs.imports.materia-theme;
2019-09-22 13:35:49 +04:00
buildInputs = with self; [ sassc bc which inkscape optipng ];
2019-09-11 17:17:56 +04:00
installPhase = ''
2019-09-22 13:35:49 +04:00
HOME=/build
2019-09-11 17:17:56 +04:00
chmod 777 -R .
patchShebangs .
2020-02-05 04:30:49 +04:00
mkdir -p $out/share/themes
2019-09-11 17:17:56 +04:00
substituteInPlace change_color.sh --replace "\$HOME/.themes" "$out/share/themes"
echo "Changing colours:"
./change_color.sh -o Generated ${materia_colors}
chmod 555 -R .
'';
};
})];
home-manager.users.alukard = {
home.packages = [pkgs.generated-gtk-theme];
gtk = {
enable = true;
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
theme = {
name = "Generated";
package = pkgs.generated-gtk-theme;
};
2019-09-22 13:35:49 +04:00
font = {
name = "Roboto 11";
package = pkgs.roboto;
};
gtk3.extraConfig.gtk-cursor-theme-name = "bibata_oil";
2019-09-11 17:17:56 +04:00
};
};
environment.sessionVariables.GTK_THEME = "Generated";
2020-02-05 04:30:49 +04:00
environment.sessionVariables.GDK_BACKEND = "x11";
2019-09-11 17:17:56 +04:00
}