-
Notifications
You must be signed in to change notification settings - Fork 722
Open
Labels
Description
If you ever try to write a Nix package that runs cabal build
, you run into this issue:
Config file /homeless-shelter/.cabal/config not found.
Writing default configuration to /homeless-shelter/.cabal/config
/homeless-shelter: createDirectory: permission denied (Permission denied)
This is because in the context of a Nix build, you don't have a home directory (and, I believe, Nix sets the HOME
variable to /homeless-shelter
, which is not a real location, just to be cute).
This isn't a huge problem - you can work around it by running HOME=$TMP cabal build
instead to use the temporary directory as your home directory - but this seems like an unnecessary complication and I'm wondering if we could avoid it altogether.
Does Cabal actually need to write to $HOME/.cabal
? Could it skip whatever it's trying to do there and just build the package?
ad-si