From ecefdd8b7d01885ceb40051be6948546b9d2f7ed Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Fri, 21 Apr 2023 18:58:34 +0100 Subject: [PATCH] Fix GNOME extensions app not launching :bug: Fixes #88. --- modules/gnome/hm.nix | 4 ++-- modules/gnome/nixos.nix | 15 ++++++++------- modules/gnome/theme.nix | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/gnome/hm.nix b/modules/gnome/hm.nix index ee1de40b..133d2cfc 100644 --- a/modules/gnome/hm.nix +++ b/modules/gnome/hm.nix @@ -1,4 +1,4 @@ -{ pkgs, config, lib, ... }: +{ pkgs, config, lib, ... }@args: with lib; @@ -28,7 +28,7 @@ with lib; xdg.dataFile."themes/Stylix/gnome-shell/gnome-shell.css" = { source = - let theme = import ./theme.nix { inherit pkgs config; }; + let theme = import ./theme.nix args; in "${theme}/share/gnome-shell/gnome-shell.css"; onChange = '' if [ -x "$(command -v gnome-extensions)" ]; then diff --git a/modules/gnome/nixos.nix b/modules/gnome/nixos.nix index 987d0511..02e402d2 100644 --- a/modules/gnome/nixos.nix +++ b/modules/gnome/nixos.nix @@ -1,9 +1,12 @@ -{ pkgs, config, ... }: +{ pkgs, config, ... }@args: let # We use this imported lib instead of the one from the module arguments # to avoid infinite loops if the lib in arguments depends on nixpkgs.overlays lib = (builtins.getFlake "github:nix-community/nixpkgs.lib/c9d4f2476046c6a7a2ce3c2118c48455bf0272ea").lib; + + theme = import ./theme.nix args; + in { options.stylix.targets.gnome.enable = lib.mkOption { @@ -24,12 +27,10 @@ in { nixpkgs.overlays = [(self: super: { gnome = super.gnome.overrideScope' (gnomeSelf: gnomeSuper: { gnome-shell = gnomeSuper.gnome-shell.overrideAttrs (oldAttrs: { - postFixup = - let theme = import ./theme.nix { inherit config; pkgs = super; }; - in '' - cp ${theme}/share/gnome-shell/gnome-shell-theme.gresource \ - $out/share/gnome-shell/gnome-shell-theme.gresource - ''; + postFixup = (oldAttrs.postFixup or "") + '' + cp ${theme}/share/gnome-shell/gnome-shell-theme.gresource \ + $out/share/gnome-shell/gnome-shell-theme.gresource + ''; patches = (oldAttrs.patches or []) ++ [ ./shell_remove_dark_mode.patch ]; diff --git a/modules/gnome/theme.nix b/modules/gnome/theme.nix index e6acfac3..fb9f4473 100644 --- a/modules/gnome/theme.nix +++ b/modules/gnome/theme.nix @@ -1,4 +1,4 @@ -{ pkgs, config }: +{ pkgs, config, ... }: let colors = config.lib.stylix.colors {