Skip to content
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

vivaldi: missing meta.mainProgram #320871

Closed
YahiaJr opened this issue Jun 18, 2024 · 0 comments · Fixed by #320943
Closed

vivaldi: missing meta.mainProgram #320871

YahiaJr opened this issue Jun 18, 2024 · 0 comments · Fixed by #320943

Comments

@YahiaJr
Copy link

YahiaJr commented Jun 18, 2024

Bug Description

Whenever lib.getExe is used with vivaldi to set it's binary path into a session variable for example, it produces a big warning stating that the meta.mainProgram attribute is missing and it will default to package name.

Steps To Reproduce

  1. Use a library function that needs the attribute meta.mainProgram like lib.getExe the vivaldi package as below:
home.sessionVariables = { 
      DEFAULT_BROWSER = lib.getExe pkgs.vivaldi;
      BROWSER = lib.getExe pkgs.vivaldi;
};
  1. Then rebuild the config: sudo nixos-rebuild switch --flake .#<HOSTNAME>
  2. During the build process a big warning will appear stating the following:
trace: warning: getExe: Package "vivaldi-6.7.3329.41" does not have the meta.mainProgram attribute. 
We'll assume that the main program has the same name for now, but this behavior is deprecated, because it leads to surprising errors when the assumption does not hold. 
If the package has a main program, please set `meta.mainProgram` in its definition to make this warning go away. 
Otherwise, if the package does not have a main program, or if you don't control its definition, use getExe' to specify the name to the program, such as lib.getExe' foo "bar".

Notify maintainers

@otwieracz , @badmutex 👋👋

Workaround For Now

Do the hint stated in the warning and use it like:

home.sessionVariables = { 
      DEFAULT_BROWSER = lib.getExe' pkgs.vivaldi "vivaldi";
      BROWSER = lib.getExe' pkgs.vivaldi "vivaldi";
};
@eclairevoyant eclairevoyant changed the title the meta.mainProgram attribute is needed to be added to Vivaldi for correct references when used with lib.getExe vivaldi: missing meta.mainProgram Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant