config/modules/macos/mac-app-store.nix

46 lines
1 KiB
Nix
Raw Normal View History

2025-05-07 10:22:05 -07:00
{
config,
lib,
pkgs,
...
2025-05-12 15:19:01 -07:00
}:
let
2025-05-07 10:22:05 -07:00
types = lib.types;
# Mapping of Mac App Store applications.
# Add new entries to this list via the App Store's share button
# https://apps.apple.com/us/app/logic-pro/id634148309?mt=12
# --------- ID HERE
allMasApps = {
# sort-lines:start
adguard = 1440147259;
final-cut-pro = 424389933;
logic-pro = 634148309;
magnet = 441258766;
motion = 434290957;
wireguard = 1451685025;
# sort-lines:end
};
# the resolved configuration from the user
masApps = config.shared.darwin.macAppStoreApps;
2025-05-12 15:19:01 -07:00
in
{
2025-05-07 10:22:05 -07:00
options = {
# Installs Mac Applications via name using homebrew.
shared.darwin.macAppStoreApps = lib.mkOption {
type = types.listOf types.str;
2025-05-12 15:19:01 -07:00
default = [ ];
2025-05-07 10:22:05 -07:00
};
};
config = lib.mkIf (builtins.length masApps > 0) {
homebrew.enable = true;
homebrew.masApps = builtins.listToAttrs (
builtins.map (name: {
inherit name;
value = allMasApps.${name};
2025-05-12 15:19:01 -07:00
}) masApps
2025-05-07 10:22:05 -07:00
);
};
}