-
Notifications
You must be signed in to change notification settings - Fork 847
Description
Our company has an Artifactory instance that we've set up to mirror/cache Hackage urls; i.e. https://artifactory.example.com/hackage/foo/bar will mirror and cache https://hackage.haskell.org/foo/bar.
Currently it's annoying to configure Stack to use this mirror; currently we have to manually create ~/.stack/config.yaml containing
package-indices:
- download-prefix: https://artifactory.example.com/hackage/
hackage-security:
keyids:
- ...
key-threshold: 3
ignore-expiry: trueSince the mirror is basically the same thing as Hackage, there's no point in duplicating all the keyids and whatnot; presumably this is all information already bundled in the Stack executable anyway.
It would be nice to have a way to just specify a URL and have it configured with the default configuration, e.g.:
# environment variable
export STACK_HACKAGE_URL=https://artifactory.example.com/hackage/
# helper command
stack config set hackage-url https://artifactory.example.com/hackage/