JakeStanger / ironbar

Customisable Wayland gtk bar written in Rust.
https://crates.io/crates/ironbar
MIT License
560 stars 47 forks source link

Add home-manager option to import a style.css file #655

Closed Alpha-Ursae-Minoris closed 3 months ago

Alpha-Ursae-Minoris commented 3 months ago

Is your feature request related to a problem? Please describe.

Currently programs.ironbar.style = only accepts nix strings concatenated with \n, this is caused by only allowing the type lib.types.lines in the option definition:

style = lib.mkOption {
              type = lib.types.lines;
              default = "";
              description = "The stylesheet to apply to ironbar.";
            };

Describe the solution you'd like

Add the option to import the css styling from a style.css file, by adding the option to import via a path. This would mirror the implementation used for the waybar.style option:

    style = mkOption {
      type = nullOr (either path lines);
      default = null;
      description = ''
        CSS style of the bar.

        See <https://github.com/Alexays/Waybar/wiki/Configuration>
        for the documentation.

        If the value is set to a path literal, then the path will be used as the css file.
      '';
      example = ''
        * {
          border: none;
          border-radius: 0;
          font-family: Source Code Pro;
        }
        window#waybar {
          background: #16191C;
          color: #AAB2BF;
        }
        #workspaces button {
          padding: 0 5px;
        }
      '';
    };

Describe alternatives you've considered

N/A

Additional context

None