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

improve package overriding inside home-manager #293

Merged
merged 1 commit into from
Feb 12, 2024
Merged

improve package overriding inside home-manager #293

merged 1 commit into from
Feb 12, 2024

Conversation

musjj
Copy link
Contributor

@musjj musjj commented Feb 8, 2024

The final overriden package is now accessible by the user via config.ags.package. This is useful if the user wants to re-use the package somewhere else.

extraPackages will also now add the packages into ags's environment, instead of just modifying buildInputs (which effectively does nothing).

@Aylur
Copy link
Owner

Aylur commented Feb 8, 2024

the extraPackages expects gobject based libraries to add to gjs's runtime
they need to be passed to buildInputs in order for wrapGAppsHook to work, they don't work if you add them to PATH

@musjj
Copy link
Contributor Author

musjj commented Feb 8, 2024

Oh, I see, didn't know that was the intended usage. But still, in home-manager the extraPackages option is usually used to add packages to the PATH, by convention.

Couldn't the user just use with pkgs; ags.overrideAttrs (oldAttrs: { buildInputs: [ cowsay ] ++ oldAttrs.buildInputs })? It's more wordy, but it conveys the intention better.

Or should there be a new option for this? It could be called extraBuildInputs.

@Aylur
Copy link
Owner

Aylur commented Feb 8, 2024

They could write it out yes, but the point of the home-manager modules is to not write it out imo.
I searched through some NixOS options and the extraPackages is used mostly for PATH and additional runtime packages, for example python programs, thats why I went with it

@musjj
Copy link
Contributor Author

musjj commented Feb 9, 2024

Yeah, but unfortunately putting packages in buildInputs won't make them show up in the program's PATH, at least not without extra logic.

What about having extraPackages put the packages both in buildInputs and the PATH? The downside is extra build time if the user doesn't need both of them.

@Aylur
Copy link
Owner

Aylur commented Feb 9, 2024

I guess we could do that, but why not just use home.packages? do you want to have a program only in gjs's PATH and not globally?

@musjj
Copy link
Contributor Author

musjj commented Feb 10, 2024

I was trying to use ags from inside a service, but I realized that I could've just used the Environment option for that (or just make my own wrapper).

I decided to go for a finalPackage option instead, which seems more idiomatic in the nix world (sorry for the force-push).

@Aylur Aylur merged commit ca32986 into Aylur:main Feb 12, 2024
2 checks passed
gorsbart pushed a commit to gorsbart/ags that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants