Build gresource within GNOME shell derivation ♻️
This commit is contained in:
parent
43a0330a31
commit
34a852baee
1 changed files with 10 additions and 35 deletions
|
|
@ -2,39 +2,7 @@
|
|||
|
||||
with lib;
|
||||
|
||||
let
|
||||
colors = config.lib.stylix.colors {
|
||||
template = builtins.readFile ./colors.mustache;
|
||||
extension = "scss";
|
||||
};
|
||||
|
||||
theme = pkgs.stdenv.mkDerivation {
|
||||
name = "stylix-gnome-shell";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "mirror://gnome/sources/gnome-shell/43/gnome-shell-43.2.tar.xz";
|
||||
sha256 = "52/UvpNCQQ7p+9zday2Bxv8GDnyMxaDxyuanq6JdGGA=";
|
||||
};
|
||||
|
||||
patches = [ ./shell.patch ];
|
||||
postPatch = ''
|
||||
rm data/theme/gnome-shell-sass/{_colors.scss,_palette.scss}
|
||||
cp ${colors} data/theme/gnome-shell-sass/_colors.scss
|
||||
'';
|
||||
|
||||
nativeBuildInputs = with pkgs; [ sass glib.dev ];
|
||||
buildPhase = ''
|
||||
sass data/theme/gnome-shell.scss >data/theme/gnome-shell.css
|
||||
# cp data/theme/gnome-shell.css data/theme/gnome-shell-high-contrast.css
|
||||
glib-compile-resources --sourcedir=data/theme data/gnome-shell-theme.gresource.xml
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mv data/gnome-shell-theme.gresource $out
|
||||
'';
|
||||
};
|
||||
|
||||
in {
|
||||
{
|
||||
options.stylix.targets.gnome.enable =
|
||||
config.lib.stylix.mkEnableTarget "GNOME" config.services.xserver.desktopManager.gnome.enable;
|
||||
|
||||
|
|
@ -65,9 +33,16 @@ in {
|
|||
nixpkgs.overlays = [(self: super: {
|
||||
gnome = super.gnome.overrideScope' (gnomeSelf: gnomeSuper: {
|
||||
gnome-shell = gnomeSuper.gnome-shell.overrideAttrs (oldAttrs: {
|
||||
postFixup = ''
|
||||
cp ${theme} $out/share/gnome-shell/gnome-shell-theme.gresource
|
||||
postPatch = let
|
||||
colors = config.lib.stylix.colors {
|
||||
template = builtins.readFile ./colors.mustache;
|
||||
extension = "scss";
|
||||
};
|
||||
in (oldAttrs.postPatch or "") + ''
|
||||
rm data/theme/gnome-shell-sass/{_colors.scss,_palette.scss}
|
||||
cp ${colors} data/theme/gnome-shell-sass/_colors.scss
|
||||
'';
|
||||
patches = (oldAttrs.patches or []) ++ [ ./shell.patch ];
|
||||
});
|
||||
});
|
||||
})];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue