diff --git a/configs/nixos/desktop/default.nix b/configs/nixos/desktop/default.nix index 01b1ab9..e74d4bc 100644 --- a/configs/nixos/desktop/default.nix +++ b/configs/nixos/desktop/default.nix @@ -144,5 +144,6 @@ with lib; { services.flatpak.packages = [ "app.fotema.Fotema" + "org.gnome.design.Palette" ]; } diff --git a/modules/home/stylix/default.nix b/modules/home/stylix/default.nix index 260cd3f..3d4df8f 100644 --- a/modules/home/stylix/default.nix +++ b/modules/home/stylix/default.nix @@ -8,7 +8,7 @@ with lib; let cfg = config.stylix; in { - imports = [./targets/steam ./targets/firefox]; + imports = [./targets/steam ./targets/firefox ./targets/flatpak]; config = mkIf cfg.enable { stylix = { diff --git a/modules/home/stylix/targets/flatpak/default.nix b/modules/home/stylix/targets/flatpak/default.nix new file mode 100644 index 0000000..f15db24 --- /dev/null +++ b/modules/home/stylix/targets/flatpak/default.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + pkgs, + ... +}: { + options.stylix.targets.flatpak.enable = config.lib.stylix.mkEnableTarget "Flatpak" true; + + config = lib.mkIf (config.stylix.enable && config.stylix.targets.flatpak.enable) { + services.flatpak.overrides.global = { + Context.filesystems = ["/nix/store" config.home.homeDirectory]; + Environment.GTK_THEME = config.gtk.theme.name; + }; + + home.file.".themes/${config.gtk.theme.name}".source = pkgs.stdenv.mkDerivation { + name = "flattenedGtkTheme"; + src = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}"; + + installPhase = '' + mkdir $out + cp -rL . $out + + config="${config.xdg.configFile."gtk-3.0/gtk.css".source}" + cat "$config" >> $out/gtk-3.0/gtk.css + cat "$config" >> $out/gtk-4.0/gtk.css + ''; + }; + + gtk.theme.package = lib.mkDefault null; + }; +} diff --git a/modules/home/stylix/targets/steam/default.nix b/modules/home/stylix/targets/steam/default.nix index b754994..f6dcfdc 100644 --- a/modules/home/stylix/targets/steam/default.nix +++ b/modules/home/stylix/targets/steam/default.nix @@ -9,14 +9,14 @@ config = lib.mkIf (config.stylix.enable && config.stylix.targets.steam.enable) { home.packages = with pkgs; [adwsteamgtk]; - home.activation.applyAdwaitaForSteam = let - shellScript = pkgs.writeShellScript "aplyAdwaitaForSteam" '' + home.activation.adwaitaForSteam = let + shellScript = pkgs.writeShellScript "adwaitaForSteam" '' rm -f "$HOME/.cache/AdwSteamInstaller/extracted/custom/custom.css" ${lib.getExe pkgs.adwsteamgtk} -i ''; in config.lib.dag.entryAfter ["writeBoundary" "dconfSettings"] '' - run ${shellScript} + run --quiet ${shellScript} ''; xdg.configFile."AdwSteamGtk/custom.css".source = config.lib.stylix.colors {