feat: user-packages and system-packages batteries#447
feat: user-packages and system-packages batteries#447charlesfire wants to merge 24 commits intodenful:mainfrom
Conversation
…hub.com/charlesfire/den into feature-provides-user-or-system-package
|
Just skimmed this pr so I hope I'm understanding properly. But this battery would allow for the reduction of boilerplate in aspect provides when said provide contains only Essentially allowing for cutting down boilerplate in simple provides which are currently written like this by removing the following boilerplate at the top of that file: |
|
Yes, this is to reduce boilerplate code. When I was rewriting my NixOS config, I noticed I was making a lot of aspects that included a single package because I wanted to keep things modular and I ended up having a lot of almost identical files. This is an attempt at reducing the boilerplate without making things less modular. |
|
I'm not sure about using strings for package names. We do that on unfree befcause that battry actually is about list of package names nor packages themselves. How about instead of list of strings, having Also, we could have a single battery |
…rning a list of packages
|
I've reworked the code to provide a single battery pkgs which also provides to-host, to-user and to-home helpers, as per @vic suggestions. However, I couldn't figure out a way to include the helpers as attributes of the pkgs battery (to enable the The current behavior :
|
This is a preliminary implementation of the user-packages and system-packages batteries as suggested in Feature requests braindump.
These new batteries allow the following pattern :
Potential improvements/alternative api:
den._.user-packages "prismlauncher" # also valid : den._.user-packages [ "prismlauncher" "archipelago" ]den._.user-package "prismlauncher"den._.user-package "prismlauncher" # also valid : den._.user-packages [ "prismlauncher" "archipelago" ]den._.aspect-with-packages [ "prismlauncher" ] # includes prismlauncher in systemPackages when in host-only context and includes prismlauncher in user packages when in user context.den._.user-packages [ "discord" ] true # includes discord package and allow unfree discord