nix-community / home-manager

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

Rofi: nested sets aren't supported in `extraConfig` #4783

Open e-tho opened 8 months ago

e-tho commented 8 months ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Multiple Rofi parameters can benefit from nested sets, for example when defining parameters by mode.

Currently, if I try to build with this configuration

    extraConfig = {
      # (...)
      filebrowser = {
       directory = "$HOME";
       sorting-method = "name";
       directories-first = true;
      };
    };

error The option home-manager.users.username.programs.rofi.extraConfig.filebrowser.directory' does not exist occurs.

Here's the type of extraConfig: (attribute set of (string or signed integer or boolean or (Rasi literal string) or list of (string or signed integer or boolean or (Rasi literal string)))) or string

from Rofi documentation:

 -display-{mode} string

       Set the name to use for mode. This is used as prompt and in combi-browser.

       It is now preferred to use the configuration file:

              configuration {
                {mode} {
                  display-name: *string*;
                }
              }

Maintainer CC

@thiagokokada

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.6.6, NixOS, 24.05 (Uakari), 24.05.20231211.a9bf124`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
stale[bot] commented 5 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

JaCoB1123 commented 5 months ago

I'm having the same issue on NixOS on the unstable channel.

beh-10257 commented 5 months ago

just remove stale bots they are stupid and this is an actual issue that should be fixed are there any workaround btw at the moment

vhsdream commented 5 months ago

Yeah the workaround is to not use nested sets, like so:

extraConfig = {
      modi = "drun,run,window,ssh";
      display-run = "open:";
      display-drun = "open:";
      drun-display-format = "{name}";
      parse-known-hosts = false;
};

The above works, however trying

extraConfig = {
      modi = "drun,run,window,ssh";
      run,drun = {
          display-name = "open:";
      };
      drun-display-format = "{name}";
      parse-known-hosts = false;
};

does not.

beh-10257 commented 5 months ago

thanks a lot it works

e-tho commented 5 months ago

This only works in this particular case, as it is not currently possible to set settings per mode in extraConfig.

The module should anyway be revised to dissociate settings and extraConfig, as most home-manager modules do.

Please add a thumbs-up to this issue if you encounter the same - it's the best way to prioritize its handling.

thiagokokada commented 5 months ago

Heads-up: I don't use rofi anymore so I am not interested in working on this feature.

I will probably remove myself from the maintainer list for rofi, but if someone wants to work in this PR I would like to ask to just go and remove me as a maintainer (and also add yourself as the maintainer since the module needs someone).

Bahex commented 4 months ago

My workaround is to just embed the text directly using mkLiteral. The attr key has to start with // to become a comment in the final file.

extraConfig = {
  display-drun = "DRun";
  modi = ["drun" "run" "ssh"];
  "// lol" = config.lib.formats.rasi.mkLiteral ''
      drun {
        parse-system: true;
        parse-user: true;
        scan-desktop: true;
      }
    // '';
};
stale[bot] commented 1 month ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.