Skip to content

bug: broot config unable to override imports #4603

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

Closed
2 tasks done
cgahr opened this issue Oct 24, 2023 · 3 comments
Closed
2 tasks done

bug: broot config unable to override imports #4603

cgahr opened this issue Oct 24, 2023 · 3 comments
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@cgahr
Copy link

cgahr commented Oct 24, 2023

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

I used the following config for broot:

programs.broot.settings = {
  imports = [ "verbs.hjson" ];
}

The generated config is

content_search_max_file_size = "10MB"
imports = [
  "verbs.hjson", 
  {file = "skins/dark-blue.hjson", luma = ["dark", "unknown"]}, 
  {file = "skins/white.hjson", luma = "light"}, 
  "verbs.hjson"
]
modal = false
show_selection_mark = true
verbs = []

[skin]

[special_paths]
"/media" = "no-enter"

The problem is, that it is impossible to override the default value for imports. In general, a user might want to set

imports = []

to remove all imports. Afaik, this is not possible right now.

Also, and this is minor, some of the existing default options are not documented:

  • content_search_max_file_size
  • show_selection_mark
  • special_paths

Maintainer CC

@aheaume @dermetfan

System information

- system: `"x86_64-linux"`
- host os: `Linux 6.2.0-35-generic, Ubuntu, 22.04.3 LTS (Jammy Jellyfish), nobuild`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.16.1`
- channels(root): `"nixpkgs"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@cgahr cgahr added bug triage Issues or feature request that have not been triaged yet labels Oct 24, 2023
@dermetfan
Copy link
Collaborator

Looks like the module system's merging rules. Did you try imports = lib.mkForce [ "verbs.hjson" ];?

@cgahr
Copy link
Author

cgahr commented Oct 24, 2023

Works like a charm!

If you want, I can add a PR to update the documentation mentioning the missing arguments and how to override imports.

@dermetfan
Copy link
Collaborator

While the module system is documented I would not be opposed to mentioning this in the description of programs.broot.settings, maybe like this:

-      description = "Verbatim config entries";
+      description = ''
+        Verbatim config entries.
+        Note that this is merged with broot's defaults,
+        so to override use `lib.mkForce`.
+      '';

I'm closing this issue as the original question is answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

5 participants