Skip to content

Commit a40d508

Browse files
committed
gnome: use overlay.nix
1 parent 838df8b commit a40d508

File tree

2 files changed

+37
-27
lines changed

2 files changed

+37
-27
lines changed

modules/gnome/nixos.nix

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
config,
55
...
66
}:
7-
8-
let
9-
theme = pkgs.callPackage ./theme.nix {
10-
inherit (config.lib.stylix) colors;
11-
inherit (config.stylix) inputs;
12-
};
13-
14-
in
157
{
168
options.stylix.targets.gnome.enable =
179
config.lib.stylix.mkEnableTarget "GNOME and GDM" true;
@@ -34,25 +26,6 @@ in
3426
# which will then download the pack regardless of its exclusion below.
3527
environment.gnome.excludePackages = [ pkgs.gnome-backgrounds ];
3628

37-
nixpkgs.overlays = [
38-
(_: super: {
39-
gnome-shell = super.gnome-shell.overrideAttrs (oldAttrs: {
40-
# Themes are usually applied via an extension, but extensions are
41-
# not available on the login screen. The only way to change the
42-
# theme there is by replacing the default.
43-
postFixup =
44-
(oldAttrs.postFixup or "")
45-
+ ''
46-
cp ${theme}/share/gnome-shell/gnome-shell-theme.gresource \
47-
$out/share/gnome-shell/gnome-shell-theme.gresource
48-
'';
49-
patches = (oldAttrs.patches or [ ]) ++ [
50-
./shell_remove_dark_mode.patch
51-
];
52-
});
53-
})
54-
];
55-
5629
# Cursor settings are usually applied via Home Manager,
5730
# but the login screen uses a separate database.
5831
environment.systemPackages = lib.mkIf (config.stylix.cursor != null) [

modules/gnome/overlay.nix

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
lib,
3+
config,
4+
pkgs,
5+
...
6+
}:
7+
{
8+
overlay =
9+
lib.mkIf (config.stylix.enable && config.stylix.targets.gnome.enable or false)
10+
(
11+
_: super: {
12+
gnome-shell = super.gnome-shell.overrideAttrs (
13+
oldAttrs:
14+
let
15+
theme = pkgs.callPackage ./theme.nix {
16+
inherit (config.lib.stylix) colors;
17+
inherit (config.stylix) inputs;
18+
};
19+
in
20+
{
21+
# Themes are usually applied via an extension, but extensions are
22+
# not available on the login screen. The only way to change the
23+
# theme there is by replacing the default.
24+
postFixup =
25+
(oldAttrs.postFixup or "")
26+
+ ''
27+
cp ${theme}/share/gnome-shell/gnome-shell-theme.gresource \
28+
$out/share/gnome-shell/gnome-shell-theme.gresource
29+
'';
30+
patches = (oldAttrs.patches or [ ]) ++ [
31+
./shell_remove_dark_mode.patch
32+
];
33+
}
34+
);
35+
}
36+
);
37+
}

0 commit comments

Comments
 (0)