nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.07k stars 1.82k forks source link

bug: rofi module cannot handle nested selectors in theme #4268

Closed jtrees closed 1 year ago

jtrees commented 1 year ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

My current rofi theme includes the following:

element selected {
  text-color: #8aadf4;
}

Attempting to express this in nix via the theme property, like so, fails:

{
  programs.rofi.theme = {
    element = {
      selected = { text-color: mkLiteral "#8aadf4"; };
    };
  };
}

Error:

building the system configuration...
error: The option `home-manager.users.josh.programs.rofi.theme.element.selected.text-color' does not exist. Definition values:
       - In `/home/josh/dotfiles/rofi':
           {
             _type = "literal";
             value = "#8aadf4";
           }

Maintainer CC

@thiag

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.1.38, NixOS, 23.05 (Stoat), 23.05.2084.08700de174b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(root): `"home-manager-23.05.tar.gz, nixos-23.05, nixos-unstable"`
 - channels(josh): `"release-22.11.tar.gz-22.11.tar.gz"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
ncfavier commented 1 year ago
"element selected".text-color = mkLiteral "#8aadf4";

seems to work fine.

jtrees commented 1 year ago

Oh oops. I tried element.selected but didn't think to try element selected. Thanks!