Skip to content

Conversation

awwpotato
Copy link
Contributor

Submission Checklist

Notify Maintainers

@mightyiam

@awwpotato awwpotato added the backport: release-25.05 Changes to release-25.05 stable branch label Jul 28, 2025
@stylix-automation stylix-automation bot added topic: home-manager Home Manager target topic: modules /modules/ subsystem labels Jul 28, 2025
@awwpotato awwpotato force-pushed the i3status-rust-mkTarget branch 2 times, most recently from 5c5b45d to 860f1ff Compare July 29, 2025 16:42
@awwpotato awwpotato requested a review from Flameopathic July 29, 2025 16:42
@awwpotato awwpotato force-pushed the i3status-rust-mkTarget branch 2 times, most recently from 1456c9f to 1201618 Compare July 30, 2025 17:53
Copy link
Member

@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.

LGTM.

@awwpotato awwpotato force-pushed the i3status-rust-mkTarget branch from 1201618 to 40eaa81 Compare August 6, 2025 00:14
@awwpotato
Copy link
Contributor Author

made the color part work when opacity is null

@trueNAHO trueNAHO requested a review from mightyiam August 7, 2025 19:14
@awwpotato awwpotato force-pushed the i3status-rust-mkTarget branch from 40eaa81 to 0f3f91f Compare August 7, 2025 20:23
Copy link
Member

@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.

LGTM, but hard to say whether this truly works without any testing.

@mightyiam
Copy link
Contributor

Sorry. It's on my list.

@mightyiam
Copy link
Contributor

I took a moment to try and got this:

error: The option `home-manager.users.mightyiam.programs.i3status-rust.bars.bottom.critical_bg' does not exist. Definition values:
       - In `/nix/store/rdck24kjc8l8p6c2gvmg1kkvcfh1akpk-source/inputs/stylix/modules/i3status-rust/hm.nix': "#fb4934D9"

Perhaps the way in which I am currently applying the provided style would help:
https://github.com/mightyiam/infra/blob/e5a843d957ffea7f1691733a8b1780fd15bb7cca/modules/window-manager/bars.nix#L14

@awwpotato awwpotato force-pushed the i3status-rust-mkTarget branch from 0f3f91f to b5f61a2 Compare August 18, 2025 19:44
@awwpotato awwpotato removed the request for review from mightyiam August 18, 2025 19:49
@stylix-automation stylix-automation bot requested a review from mightyiam August 18, 2025 19:54
Copy link
Contributor

@mightyiam mightyiam left a comment

Choose a reason for hiding this comment

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

I think it should be like this. I'm going to paste the entire file here.:

{ mkTarget, lib, ... }:
let
  themeOverrides =
    { cfg, colors }:
    lib.mapAttrs (n: v: if lib.hasSuffix "_bg" n then v + cfg.bgOpacity else v) (
      with colors.withHashtag;
      {
        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;
      }
    );
in
mkTarget {
  name = "i3status-rust";
  humanName = "i3status-rust";

  extraOptions = {
    barNames = lib.mkOption {
      type = with lib.types; listOf str;
      default = [ ];
      description = "i3status-rust bars to apply theming to.";
      example = [ "default" ];
    };
    bgOpacity = lib.mkOption {
      type = lib.types.float;
      default = 1.0;
      internal = true;
      apply = v: lib.toHexString (builtins.ceil (v * 255));
    };
  };

  imports = lib.singleton (
    { config, ... }:
    {
      lib.stylix.i3status-rust.bar =
        lib.warn
          "stylix: `config.lib.stylix.i3status-rust.bar` has been replace with `config.stylix.targets.i3status-rust.barNames` and will be removed after 26.11."
          (themeOverrides {
            cfg = config.stylix.targets.i3status-rust;
            inherit (config.lib.stylix) colors;
          });
    }
  );

  configElements = [
    (
      { opacity }:
      {
        stylix.targets.i3status-rust.bgOpacity = opacity.desktop;
      }
    )
    (
      { cfg, colors }:
      {
        programs.i3status-rust.bars = lib.genAttrs cfg.barNames (_: {
          settings.theme.overrides = themeOverrides { inherit cfg colors; };
        });
      }
    )
  ];
}

@mightyiam
Copy link
Contributor

With the contents of the file I pasted above, I have tested both the lib usage that comes with a warning and the new barNames option. In both cases there were no changes to my home derivation. Oh, and for reference:
https://github.com/greshake/i3status-rust/blob/db4db28eda9bbf8b7fc61ddad65a00207be9368b/examples/config.toml

@Flameopathic
Copy link
Contributor

@awwpotato what is the status of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: release-25.05 Changes to release-25.05 stable branch topic: home-manager Home Manager target topic: modules /modules/ subsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants