Open jmuchovej opened 4 years ago
@lra so, I just saw: #1291 – forgot to take a gander through PRs. 😅 i think it's definitely possible to consider this (~/.Brewfile
) to be a globally accepted config. however, it's only used in a brew bundle install
and brew bundle dump
– this is less of a program config and more of an OS config, per se. (if that makes sense?)
It's not super clear, at least from what I've seen, that the explicit goal of mackup
is just to manage program configurations, which is why I had hoped supporting brew-bundle
might be a feasible thing to do. (definitely don't mind doing it, just wanted to raise the topic before putting dev time into it.)
I also sync my ~/.Brewfile
with mackup via a custom .cfg file... doing the dump and restore automatically seems a little overkill, but I think it could be useful to revisit #1291.
I personally consider my ~/.Brewfile to functionally be my system-wide configuration for homebrew
, in the same way I have configurations for specific apps
I personally consider my ~/.Brewfile to functionally be my system-wide configuration for
homebrew
, in the same way I have configurations for specific apps
I don't think it makes much sense to care a lot about Brewfiles
that aren't ~/.Brewfile
. Mostly because homebrew
doesn't support something analogous to a virtualenv
. Kinda adding support for not really pursuing the dumping/restoring I was talking about.
I also sync my
~/.Brewfile
with mackup via a custom .cfg file... doing the dump and restore automatically seems a little overkill, but I think it could be useful to revisit #1291.
I'm currently doing the same with a custom .cfg
. While I don't find adding a "dump/restore functionality" to be overkill, I could definitely see how/why it might not fit into the goals of mackup
.
If the ~/.Brewfile
is now officially supported, we can add it to the database for sure:
PR welcome!
If the ~/.Brewfile is now officially supported, we can add it to the database for sure
That location is the officially sanctioned place to read a "global" brew file, but it's not the default location that brew files get written to. By default it writes to "Brewfile" (no .
) in whatever directory you're currently in. In practice, this means that means that most people's Brewfiles are probably located at ~/Brewfile
and not ~/.Brewfile
.
Bummer. Thoughts?
Broadly, adding official support for
brew bundle
So glad I found this, handles quite a bit of what I've done with shell scripting. Apologies on the long post, I figured it would be easier to outline everything as much as possible. 😅
Inspiration / Background:
I've haphazardly automated some of my config backups and package installation, but
mackup
does a better job generalizing than I have, at least on the config side. 😀Does it make sense for
mackup
to potentially support acting as a [rudimetnary] package exporter/installer?brew
is trying to support Linux. I think strictly supportingbrew
might keepmackup
from detrimentally expanding it's scope, while still maintaining a degree of platform agnosticism.Brewfile
s are easily exported frombrew bundle
, but they need to be generated. It's easy enough to write-up a script to do the exports, butmackup
doesn't supportBrewfile
s, period.Preliminary thoughts on what supporting this might entail:
Naïvely (I currently do this with a local application file, in
~/.mackup
):Brewfile
application that uses the "global"~/.Brewfile
thatbrew bundle
supports. This shouldn't modify the behavior ofmackup
, it just addsBrewfile
support.More nicely (a personal favorite)
Support generating a "custom"
Brewfile
(that is, it can be arbitrarily placed). This does like above, but I think would necessitate modifying~/.mackup.cfg
to allow users to specify a particular location for this. Maybe something like...mackup
provides a new commandsetup
, which differs frommackup restore
only in that it prompts the user about performing an action likebrew bundle install --file=<file>
. Honestly, this could just be a question asked bymackup restore
.Brewfile
diff, of some sort (I need to look into this further). The main idea here is to check whether or not they've installed any packages since the lastBrewfile
was dumped and do abrew bundle dump --file=
if they have. Naïvely we could just ask to overwrite theBrewfile
, I'm not not sure of the impact on how quicklymackup
might be able to run a diff (sincebrew
can sometimes take a minute).Notes on specifying file locations:
Brewfile
(though this could be a hangup for people trying to usebrew
on MacOS and Linux).XDG_CONFIG_HOME
compliance as possible, so a sensible default to me would be to place the Brewfile in~/.config/brew/Brewfile
. (Opening another issue about globally preferring$XDG_CONFIG_HOME
as a preference.)brew
supports a global~/.Brewfile
which could also be a default that's used.~/.mackup.cfg