-
-
Notifications
You must be signed in to change notification settings - Fork 300
gtksourceview: use simpiler enable check, disable by default #2110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
brckd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Code and CI looks good.
|
I just opened #2112 with some more ideas around this. We would likely want to disable code patches by default anyway, so this PR shouldn't be blocked by that. |
trueNAHO
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a66458eae1c7c73b5ada93066faaf197f65aa660 Mon Sep 17 00:00:00 2001 From: 0xda157 <[email protected]> Date: Fri, 26 Dec 2025 12:11:29 -0800 Subject: [PATCH 1/3] gtksourceview: use simpler `or false` in enabled check --- modules/gtksourceview/overlay.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/gtksourceview/overlay.nix b/modules/gtksourceview/overlay.nix index 8c8d5b751..2aac4c69e 100644 --- a/modules/gtksourceview/overlay.nix +++ b/modules/gtksourceview/overlay.nix @@ -21,11 +21,7 @@ in overlay = _final: prev: optionalAttrs - ( - config.stylix.enable - && config.stylix.targets ? gtksourceview - && config.stylix.targets.gtksourceview.enable - ) + (config.stylix.enable && config.stylix.targets.gtksourceview.enable or false) { gnome2 = prev.gnome2 // { gtksourceview = prev.gnome2.gtksourceview.overrideAttrs (attrsOverride "2.0");
LGTM.
From b712de35a85897a60b72d5769b0f83fdb0022667 Mon Sep 17 00:00:00 2001 From: 0xda157 <[email protected]> Date: Fri, 26 Dec 2025 12:15:42 -0800 Subject: [PATCH 2/3] gtksourceview: disable by default --- modules/gtksourceview/hm.nix | 2 ++ modules/gtksourceview/meta.nix | 6 ++++++ modules/gtksourceview/nixos.nix | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/gtksourceview/hm.nix b/modules/gtksourceview/hm.nix index 02bf853b8..479bac279 100644 --- a/modules/gtksourceview/hm.nix +++ b/modules/gtksourceview/hm.nix @@ -1,5 +1,7 @@ { mkTarget, lib, ... }: mkTarget { + autoEnable = false; + config = { colors, ... }: { diff --git a/modules/gtksourceview/meta.nix b/modules/gtksourceview/meta.nix index 3d860e9d1..ca47da57b 100644 --- a/modules/gtksourceview/meta.nix +++ b/modules/gtksourceview/meta.nix @@ -2,4 +2,10 @@ { maintainers = [ lib.maintainers.bricked ]; name = "GTKSourceView"; + description = '' + > [!WARNING] + > GTKSourceView is disabled by default because it causes many packages + > to no longer be cached in hydra, forcing the user to compile these
Should this refer to hydra or https://cache.nixos.org?
+ > packages themselves. + ''; } diff --git a/modules/gtksourceview/nixos.nix b/modules/gtksourceview/nixos.nix index 40f8bd18e..c5c361d6d 100644 --- a/modules/gtksourceview/nixos.nix +++ b/modules/gtksourceview/nixos.nix @@ -1,3 +1,3 @@ { mkTarget, ... }: # Used to enable overlay. -mkTarget { } +mkTarget { autoEnable = false; }[...]
I just opened #2112 with some more ideas around this. We would likely want to disable code patches by default anyway, so this PR shouldn't be blocked by that.
Would it not be better to enable as much as possible by default to provide the most feature-complete default experience:
Lines 11 to 15 in b135edb
| Unlike color scheme utilities such as | |
| [base16.nix](https://github.com/SenchoPens/base16.nix) or | |
| [nix-colors](https://github.com/Misterio77/nix-colors), Stylix goes further by | |
| applying themes to supported applications, following the "it just works" | |
| philosophy. |
IMHO, it would be better for users to explicitly opt-out from uncached https://cache.nixos.org packages by disabling relevant modules. Until the #2112 interface is implemented, the "Tips and tricks" (/doc/src/tricks.md) documentation section could list modules that are known to potentially drastically increase build time.
From 036fbc5b0a2fa5e687a871c65cf3915125b869c7 Mon Sep 17 00:00:00 2001 From: 0xda157 <[email protected]> Date: Fri, 26 Dec 2025 12:22:46 -0800 Subject: [PATCH 3/3] gtksourceview: add testbed --- modules/gnome-text-editor/testbeds/gnome-text-editor.nix | 1 + modules/gtksourceview/testbeds/gtksourceview.nix | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 modules/gtksourceview/testbeds/gtksourceview.nix diff --git a/modules/gnome-text-editor/testbeds/gnome-text-editor.nix b/modules/gnome-text-editor/testbeds/gnome-text-editor.nix index 2022e2b20..a70579106 100644 --- a/modules/gnome-text-editor/testbeds/gnome-text-editor.nix +++ b/modules/gnome-text-editor/testbeds/gnome-text-editor.nix @@ -1,3 +1,4 @@ +# NOTE: ../../gtksourceview/testbeds/gtksourceview.nix depends on this file { pkgs, ... }: { stylix.testbed.ui.command.text = "gnome-text-editor flake-parts/flake.nix"; diff --git a/modules/gtksourceview/testbeds/gtksourceview.nix b/modules/gtksourceview/testbeds/gtksourceview.nix new file mode 100644 index 000000000..a2b35c801 --- /dev/null +++ b/modules/gtksourceview/testbeds/gtksourceview.nix @@ -0,0 +1,5 @@ +{ + imports = [ ../../gnome-text-editor/testbeds/gnome-text-editor.nix ]; + + stylix.targets.gtksourceview.enable = true; +}
When stylix.targets.gtksourceview.enable stays enabled by default, the following is no longer necessary:
diff --git a/modules/gtksourceview/testbeds/gtksourceview.nix b/modules/gtksourceview/testbeds/gtksourceview.nix
index a2b35c80..4a5ecbbf 100644
--- a/modules/gtksourceview/testbeds/gtksourceview.nix
+++ b/modules/gtksourceview/testbeds/gtksourceview.nix
@@ -1,5 +1,3 @@
{
imports = [ ../../gnome-text-editor/testbeds/gnome-text-editor.nix ];
-
- stylix.targets.gtksourceview.enable = true;
}Otherwise, "PATCH 3/3" LGTM.
relevant: #2107 (comment)
Note
this is a breaking change, so only
gtksourceview: use simpler or false in enabled checkshould be backported.