Skip to content
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

i3status-rust: init #548

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

i3status-rust: init #548

wants to merge 1 commit into from

Conversation

zackattackz
Copy link

I had these colors from stylix set in my hm configs. But I figured I should add them to the stylix repo for other users of i3status-rust!

Kept it short and sweet but let me know if anything is needed :)

@zackattackz
Copy link
Author

Would I need to write anything to documentation for this? Or is that automatically taken care of?

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had these colors from stylix set in my hm configs. But I figured I should add them to the stylix repo for other users of i3status-rust!

Thanks for sharing!

Would I need to write anything to documentation for this? Or is that automatically taken care of?

Options are automatically injected into the documentation.

From 4fdf452b9688b0f4be1d159d3cbdaf326117ad8d Mon Sep 17 00:00:00 2001
From: Zachary Hanham <z.hanham00@gmail.com>
Date: Sun, 8 Sep 2024 13:43:16 -0400
Subject: [PATCH] i3status-rust: init

---
 modules/i3status-rust/hm.nix | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 modules/i3status-rust/hm.nix

diff --git a/modules/i3status-rust/hm.nix b/modules/i3status-rust/hm.nix
new file mode 100644
index 00000000..39d182f8
--- /dev/null
+++ b/modules/i3status-rust/hm.nix
@@ -0,0 +1,25 @@
+{ config, lib, ... }:
+
+let
+  colors = config.lib.stylix.colors.withHashtag;
+in
+{
+  options.stylix.targets.i3status-rust.enable = config.lib.stylix.mkEnableTarget "i3status-rust" true;
+
+  config = lib.mkIf (config.stylix.enable && config.stylix.targets.i3status-rust.enable) {
+    programs.i3status-rust.bars.default.settings.theme.overrides = with colors; {
+      idle_bg = base00;
+      idle_fg = base05;
+      info_bg = base09;
+      info_fg = base05;
+      good_bg = base01;
+      good_fg = base05;
+      warning_bg = base0A;
+      warning_fg = base05;
+      critical_bg = base08;
+      critical_fg = base04;
+      separator_bg = base00;
+      separator_fg = base05;
+    };
+  };
+}

I did not test this, but LGTM.

@zackattackz
Copy link
Author

@trueNAHO
Thank you for the review!

As for testing I did substitute my fork in my flake input and it seemed to work well with no errors.

As for the color choices, I'm not positive they're correct, but I tried with a few different backgrounds and they looked good.

Copy link
Owner

@danth danth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using base08-base0F as a background, the corresponding foreground should be base00 instead of base05 to guarantee that the colors contrast. This affects info_fg, warning_fg and critical_fg. You might want to test this after making the change since I haven't tried it myself.

Everything else looks good :)

@zackattackz
Copy link
Author

@danth
Thanks for the input, I wasn't sure about the colors so this is good to know. I'll try it out and lyk.

@pborzenkov
Copy link
Contributor

i3status-rust supports multiple bars which can be configured differently. Will it make sense to follow the same approach as with i3 bar configuration and provide an attrset that users can merge with their per-bar config?

# Merge this with your bar configuration using //config.lib.stylix.i3.bar

@trueNAHO
Copy link
Collaborator

i3status-rust supports multiple bars which can be configured differently. Will it make sense to follow the same approach as with i3 bar configuration and provide an attrset that users can merge with their per-bar config?

# Merge this with your bar configuration using //config.lib.stylix.i3.bar

If upstream supports this, it would be a nice addition.

@zackattackz
Copy link
Author

@pborzenkov That's a good point I didn't consider, especially because you can configure multiple i3status-rust bars to match your (potentially differently themed) bars.

It should be easy to do it like that just like how you linked above, so I could amend with that change.

@zackattackz
Copy link
Author

@trueNAHO

If upstream supports this, it would be a nice addition.

If you mean home manager's programs.i3status-rust then yes it should as simple as providing the attrset to merge with programs.i3status-rust.bars.XXX.settings.theme.overrides where XXX is the name of your bar.

I actually forgot that the default in my current PR isn't a real attribute, but is just the name of my only bar.

@zackattackz
Copy link
Author

zackattackz commented Sep 10, 2024

OK I amended with danth's color suggestions as well as just making this attrset exist under config.lib.stylix.i3status-rust.bar

I tested again locally and it seems to work well. If you check the first amend, I tried to do it with lib.mkIf but it was giving an infinite recursion error. So in the latest amend I just unconditionally add it to config. Not sure if this is OK but I think it is? Updated my flake input and it worked.

An example of usage from my configs (near the bottom):

{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.i3status-rust;
in
{
  options.i3status-rust = {
    enable = mkEnableOption "i3status-rust";
  };
  config = mkIf cfg.enable {
    programs.i3status-rust = {
      enable = true;
      bars.default.blocks = [
        {
          block = "disk_space";
          path = "/";
          info_type = "available";
          interval = 60;
          warning = 20.0;
          alert = 10.0;
        }
        {
          block = "memory";
          format = " $icon $mem_used_percents ";
          interval = 2;
        }
        {
          block = "cpu";
          interval = 2;
        }
        { block = "sound"; }
        {
          block = "time";
          interval = 60;
          format = " $timestamp.datetime(f:'%a %m/%d %I:%M %p') ";
        }
      ];
      bars.default.settings.theme.overrides = config.lib.stylix.i3status-rust.bar;
    };
  };
}

@trueNAHO
Copy link
Collaborator

If you check the first amend, I tried to do it with lib.mkIf but it was giving an infinite recursion error. So in the latest amend I just unconditionally add it to config. Not sure if this is OK but I think it is?

Actually, unconditionally adding behaviour is a problem: #543.

Can you try to resolve this infinite recursion error? Btw, the error could be caused by your setup (not the Stylix patch) accessing something in a problematic way.

@zackattackz
Copy link
Author

@trueNAHO

So the infinite recursion cause is quite weird and I don't fully understand it.

It seems that it's caused by the way that stylix defines and uses mkEnableTarget.

I don't really understand why, but inlining mkEnableTarget will work, whereas using config.lib.stylix.mkEnableTarget directly will not.

I think it has something to do with the fact that I'm defining stuff in config.lib inside a mkIf with a condition made with mkEnableTarget.

To see this yourself, you can try these two files for modules/i3status-rust/hm.nix:

broken:

{ config, lib, ... }:

let
  colors = config.lib.stylix.colors.withHashtag;
  mkEnableTarget = config.lib.stylix.mkEnableTarget;
in
{
  options.stylix.targets.i3status-rust.enable = mkEnableTarget "i3status-rust" true;
  config = lib.mkIf (config.stylix.enable && config.stylix.targets.i3status-rust.enable) {
    # Merge this with your bar's theme's overrides with //config.lib.stylix.i3status-rust.bar
    lib.stylix.i3status-rust.bar = with colors; {
      idle_bg = base00;
      idle_fg = base05;
      info_bg = base09;
      info_fg = base00;
      good_bg = base01;
      good_fg = base05;
      warning_bg = base0A;
      warning_fg = base00;
      critical_bg = base08;
      critical_fg = base00;
      separator_bg = base00;
      separator_fg = base05;
    };
  };
}

working:

{ config, lib, ... }:

let
  colors = config.lib.stylix.colors.withHashtag;
  mkEnableTarget = let
    cfg = config.stylix;
  in
    humanName:
    autoEnable:
      lib.mkEnableOption
      "theming for ${humanName}"
      // {
        default = cfg.enable && cfg.autoEnable && autoEnable;
        example = !autoEnable;
      }
      // lib.optionalAttrs autoEnable {
        defaultText = lib.literalMD "same as [`stylix.autoEnable`](#stylixautoenable)";
      };
in
{
  options.stylix.targets.i3status-rust.enable = mkEnableTarget "i3status-rust" true;
  config = lib.mkIf (config.stylix.enable && config.stylix.targets.i3status-rust.enable) {
    # Merge this with your bar's theme's overrides with //config.lib.stylix.i3status-rust.bar
    lib.stylix.i3status-rust.bar = with colors; {
      idle_bg = base00;
      idle_fg = base05;
      info_bg = base09;
      info_fg = base00;
      good_bg = base01;
      good_fg = base05;
      warning_bg = base0A;
      warning_fg = base00;
      critical_bg = base08;
      critical_fg = base00;
      separator_bg = base00;
      separator_fg = base05;
    };
  };
}

So I think a solution might involve a refactor to maybe add mkEnableTarget as an argument to all the hm.nix files like so:

{ config, lib, mkEnableTarget, ... }:

But I'm not really sure, and I'm not sure why the infinite recursion happens in the first place and why inlining fixes it.

Any advice appreciated.

@zackattackz
Copy link
Author

Full trace for any curious:

error:
       … from call site

         at /nix/store/xydd991vznkvj8gfzfnn26xprh58m7xf-source/modules/default.nix:45:18:

           44|   withExtraAttrs = rawModule:
           45|     let module = moduleChecks rawModule;
             |                  ^
           46|     in {

       … while calling 'moduleChecks'

         at /nix/store/xydd991vznkvj8gfzfnn26xprh58m7xf-source/modules/default.nix:32:18:

           31|
           32|   moduleChecks = raw:
             |                  ^
           33|     showWarnings (let

       … from call site

         at /nix/store/xydd991vznkvj8gfzfnn26xprh58m7xf-source/modules/default.nix:33:5:

           32|   moduleChecks = raw:
           33|     showWarnings (let
             |     ^
           34|       failed = collectFailed raw.config;

       … while calling 'showWarnings'

         at /nix/store/xydd991vznkvj8gfzfnn26xprh58m7xf-source/modules/default.nix:15:18:

           14|
           15|   showWarnings = res:
             |                  ^
           16|     let f = w: x: builtins.trace "warning: ${w}" x;

       … from call site

         at /nix/store/xydd991vznkvj8gfzfnn26xprh58m7xf-source/modules/default.nix:17:8:

           16|     let f = w: x: builtins.trace "warning: ${w}" x;
           17|     in fold f res res.config.warnings;
             |        ^
           18|

       … while calling 'foldr'

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/lists.nix:121:20:

          120|   */
          121|   foldr = op: nul: list:
             |                    ^
          122|     let

       … from call site

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/lists.nix:128:8:

          127|         else op (elemAt list n) (fold' (n + 1));
          128|     in fold' 0;
             |        ^
          129|

       … while calling 'fold''

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/lists.nix:124:15:

          123|       len = length list;
          124|       fold' = n:
             |               ^
          125|         if n == len

       … from call site

         at /nix/store/xydd991vznkvj8gfzfnn26xprh58m7xf-source/modules/default.nix:34:16:

           33|     showWarnings (let
           34|       failed = collectFailed raw.config;
             |                ^
           35|       failedStr = concatStringsSep "\n" (map (x: "- ${x}") failed);

       … while calling 'collectFailed'

         at /nix/store/xydd991vznkvj8gfzfnn26xprh58m7xf-source/modules/default.nix:12:19:

           11|
           12|   collectFailed = cfg:
             |                   ^
           13|     map (x: x.message) (filter (x: !x.assertion) cfg.assertions);

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1096:10:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
         1097|

       … from call site

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1096:16:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
         1097|

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:707:46:

          706|         else
          707|           concatLists (mapAttrsToList (name: defs:
             |                                              ^
          708|             map (def: def // {

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:693:22:

          692|         # Propagate all unmatched definitions from nested option sets
          693|         mapAttrs (n: v: v.unmatchedDefns) resultsByName
             |                      ^
          694|         # Plus the definitions for the current prefix that don't have a matching option

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1096:10:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
         1097|

       … from call site

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1096:16:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
         1097|

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:707:46:

          706|         else
          707|           concatLists (mapAttrsToList (name: defs:
             |                                              ^
          708|             map (def: def // {

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:693:22:

          692|         # Propagate all unmatched definitions from nested option sets
          693|         mapAttrs (n: v: v.unmatchedDefns) resultsByName
             |                      ^
          694|         # Plus the definitions for the current prefix that don't have a matching option

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1096:10:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
         1097|

       … from call site

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1096:16:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
         1097|

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:707:46:

          706|         else
          707|           concatLists (mapAttrsToList (name: defs:
             |                                              ^
          708|             map (def: def // {

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:693:22:

          692|         # Propagate all unmatched definitions from nested option sets
          693|         mapAttrs (n: v: v.unmatchedDefns) resultsByName
             |                      ^
          694|         # Plus the definitions for the current prefix that don't have a matching option

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1096:10:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
         1097|

       … from call site

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1096:16:

         1095|     attrs:
         1096|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
         1097|

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:707:46:

          706|         else
          707|           concatLists (mapAttrsToList (name: defs:
             |                                              ^
          708|             map (def: def // {

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:693:22:

          692|         # Propagate all unmatched definitions from nested option sets
          693|         mapAttrs (n: v: v.unmatchedDefns) resultsByName
             |                      ^
          694|         # Plus the definitions for the current prefix that don't have a matching option

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:641:39:

          640|
          641|       resultsByName = mapAttrs (name: decls:
             |                                       ^
          642|         # We're descending into attribute ‘name’.

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:648:14:

          647|           optionDecls = filter
          648|             (m: m.options?_type
             |              ^
          649|                 && (m.options._type == "option"

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:254:72:

          253|           # For definitions that have an associated option
          254|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          255|

       … while evaluating the option `lib':

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:836:28:

          835|         # Process mkMerge and mkIf properties.
          836|         defs' = concatMap (m:
             |                            ^
          837|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/4brcbjyld2c2268i6w9ssn8ylp86cf1d-modules/i3status-rust/hm.nix':

       … from call site

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:837:128:

          836|         defs' = concatMap (m:
          837|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                ^
          838|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:908:25:

          907|   */
          908|   dischargeProperties = def:
             |                         ^
          909|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:688:37:

          687|
          688|       matchedOptions = mapAttrs (n: v: v.matchedOptions) resultsByName;
             |                                     ^
          689|

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:641:39:

          640|
          641|       resultsByName = mapAttrs (name: decls:
             |                                       ^
          642|         # We're descending into attribute ‘name’.

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:648:14:

          647|           optionDecls = filter
          648|             (m: m.options?_type
             |              ^
          649|                 && (m.options._type == "option"

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:254:72:

          253|           # For definitions that have an associated option
          254|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          255|

       error: infinite recursion encountered

       at /nix/store/5w3dp0m37794iffsbm9vd9f1xmmhda6i-source/lib/modules.nix:821:9:

          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

@zackattackz
Copy link
Author

Or even instead of { config, lib, mkEnableTarget, ... }: it could be { config, lib, stylix-lib, ... }: where stylix-lib has mkEnableTarget and other things inside it

@trueNAHO
Copy link
Collaborator

I am reluctant to modifying config.lib.stylix.mkEnableTarget or what arguments are passed to all modules for the sake of a single module, unless there is a "serious" issue.

According to #18, the i3 module is based on the Sway module, which both successfully use the config.lib.stylix.<MODULE>.<OPTION> pattern.

I assume a minor difference between your implementation and the i3 and Sway modules is causing your infinite recursion error. I suggest starting from one of those modules and modifying small parts until the i3status-rust module is done. At a first glance, your module is not using the lib.mkMerge wrapper.

Btw, I might consider improving this pattern in the future.

@zackattackz
Copy link
Author

I'll look more into it for sure 👍

@zackattackz
Copy link
Author

Ok so this new amend does work with no recursion.

I think it was because if you try to set a value in config.stylix.lib when the condition has config.stylix.lib.mkEnableOption in it, it infinitely recurses into lib because the condition requires evaluating config.stylix.lib. But it still doesn't make sense to me so I'm probably wrong here.

If anyone could explain why the "broken" one I listed above infinitely recurses, but this amend doesn't, I'd love to know.

@zackattackz
Copy link
Author

I'm not sure that this new amend satisfies #543 or not though, I believe it does?

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so this new amend does work with no recursion.

Amazing! Thanks for your hard work.

If anyone could explain why the "broken" one I listed above infinitely recurses, but this amend doesn't, I'd love to know.

Not sure either what exactly caused it.

I'm not sure that this new amend satisfies #543 or not though, I believe it does?

Actually, now I am unsure whether lib.stylix should not unconditionally expose its values since they certainly have no side effects. Sorry for the major inconvenience.

Either way, I don't mind merging 495d49d or 4fc7481. @danth, what do you think?

@zackattackz
Copy link
Author

@trueNAHO
No worries this is all good learning for me anyways so I don't mind. Thank you for your time reviewing :)

@zackattackz
Copy link
Author

I've actually discovered an issue user side with 4fc7481

If you want to add something into the stylix provided attrset, you could try:

config.lib.stylix.i3status-rust.bar // { separator = ""; }

However this won't work, because it merges the second attrset into the result of the lib.mkIf, which leaves the content untouched. (results in { _type = "if"; condition = true; content = { ... }; separator = ""; }) So the final result does not have the "separator" attribute in it. (Unless you merge it into "content" specifically, but this is really tedious and not immediately obvious)

This is not an issue with 495d49d so I think this one should be merged instead.

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've actually discovered an issue user side with 4fc7481

If you want to add something into the stylix provided attrset, you could try:

config.lib.stylix.i3status-rust.bar // { separator = ""; }

However this won't work, because it merges the second attrset into the result of the lib.mkIf, which leaves the content untouched. (results in { _type = "if"; condition = true; content = { ... }; separator = ""; }) So the final result does not have the "separator" attribute in it. (Unless you merge it into "content" specifically, but this is really tedious and not immediately obvious)

Good point. Sorry for not noticing upon reviewing.

This is not an issue with 495d49d so I think this one should be merged instead.

Could you override this PR by force pushing 495d49d?

@zackattackz
Copy link
Author

Could you override this PR by force pushing 495d49d?

Done!

trueNAHO
trueNAHO approved these changes Sep 16, 2024
@trueNAHO trueNAHO enabled auto-merge (squash) September 16, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants