modules/homebrew: add postinstall option for brews and casks
Both `brew bundle` formula and cask installers support a `postinstall` option -- a shell command to run after the package is installed or upgraded. The command only executes when the package actually changed, not on every `brew bundle` run. Examples from the Homebrew docs added to the `homebrew.brews` and `homebrew.casks` option examples and tests.
This commit is contained in:
parent
a3fd89f1bb
commit
c65c24c87c
2 changed files with 39 additions and 0 deletions
|
|
@ -50,6 +50,10 @@ in
|
|||
link = true;
|
||||
conflicts_with = [ "mysql" ];
|
||||
}
|
||||
{
|
||||
name = "postgresql@16";
|
||||
postinstall = "\${HOMEBREW_PREFIX}/opt/postgresql@16/bin/postgres -D \${HOMEBREW_PREFIX}/var/postgresql@16";
|
||||
}
|
||||
];
|
||||
|
||||
homebrew.casks = [
|
||||
|
|
@ -62,6 +66,10 @@ in
|
|||
name = "opera";
|
||||
greedy = true;
|
||||
}
|
||||
{
|
||||
name = "google-cloud-sdk";
|
||||
postinstall = "\${HOMEBREW_PREFIX}/bin/gcloud components update";
|
||||
}
|
||||
];
|
||||
|
||||
homebrew.masApps = {
|
||||
|
|
@ -92,11 +100,13 @@ in
|
|||
${mkTest "imagemagick" ''brew "imagemagick"''}
|
||||
${mkTest "denji/nginx/nginx-full" ''brew "denji/nginx/nginx-full", args: ["with-rmtp"], link: :overwrite, restart_service: :always''}
|
||||
${mkTest "mysql@5.6" ''brew "mysql@5.6", conflicts_with: ["mysql"], link: true, restart_service: true''}
|
||||
${mkTest "postgresql@16" ''brew "postgresql@16", postinstall: "''${HOMEBREW_PREFIX}/opt/postgresql@16/bin/postgres -D ''${HOMEBREW_PREFIX}/var/postgresql@16"''}
|
||||
|
||||
echo "checking cask entries in Brewfile" >&2
|
||||
${mkTest "google-chrome" ''cask "google-chrome"''}
|
||||
${mkTest "firefox" ''cask "firefox", args: { appdir: "~/my-apps/Applications" }''}
|
||||
${mkTest "opera" ''cask "opera", greedy: true''}
|
||||
${mkTest "google-cloud-sdk" ''cask "google-cloud-sdk", postinstall: "''${HOMEBREW_PREFIX}/bin/gcloud components update"''}
|
||||
|
||||
echo "checking mas entries in Brewfile" >&2
|
||||
${mkTest "1Password for Safari" ''mas "1Password for Safari", id: 1569813296''}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue