-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: Migrate Homebrew configuration to a new module structure and ena…
…ble Homebrew for aarch64-darwin
- Loading branch information
Showing
3 changed files
with
53 additions
and
33 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
lib, | ||
config, | ||
system, | ||
namespace, | ||
... | ||
}: let | ||
cfg = config.${namespace}.system.homebrew; | ||
in { | ||
options.${namespace}.system.homebrew = { | ||
enable = lib.mkOption { | ||
type = lib.types.bool; | ||
default = true; | ||
description = "Whether to enable homebrew."; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
# Enable Homebrew for casks. | ||
homebrew = { | ||
enable = true; | ||
# Upgrade and uninstall homebrew casks automatically. | ||
onActivation = { | ||
autoUpdate = true; | ||
upgrade = true; | ||
# cleanup = "uninstall"; | ||
}; | ||
}; | ||
|
||
# Add homebrew taps. | ||
homebrew.taps = [ | ||
"buo/cask-upgrade" | ||
]; | ||
|
||
# Set environment variables for homebrew mirror. | ||
environment.variables = { | ||
HOMEBREW_API_DOMAIN = "https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"; | ||
HOMEBREW_BOTTLE_DOMAIN = "https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"; | ||
HOMEBREW_BREW_GIT_REMOTE = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"; | ||
HOMEBREW_CORE_GIT_REMOTE = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"; | ||
HOMEBREW_PIP_INDEX_URL = "https://pypi.tuna.tsinghua.edu.cn/simple"; | ||
}; | ||
|
||
# Add homebrew to PATH. | ||
environment.systemPath = lib.optional (system == "aarch64-darwin") "/opt/homebrew"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters