summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-01-03 00:39:47 -0800
committerFuwn <[email protected]>2025-01-03 00:39:47 -0800
commit0037d96d3748c91d94e4b0081cf94094585f15ac (patch)
treed9d577a0eb2e90f576010efa0c015b343e4d61cf
parentnara: add new mas apps (diff)
downloadnixos-config-0037d96d3748c91d94e4b0081cf94094585f15ac.tar.xz
nixos-config-0037d96d3748c91d94e4b0081cf94094585f15ac.zip
nara: automate mas apps generator script
-rw-r--r--modules/mac/programs/homebrew/default.nix2
-rw-r--r--modules/mac/programs/homebrew/mas-apps.nix (renamed from modules/mac/programs/homebrew/mas.nix)3
-rwxr-xr-xscripts/generate_clean_mas_apps.sh10
3 files changed, 9 insertions, 6 deletions
diff --git a/modules/mac/programs/homebrew/default.nix b/modules/mac/programs/homebrew/default.nix
index 7883095..ab9bb6d 100644
--- a/modules/mac/programs/homebrew/default.nix
+++ b/modules/mac/programs/homebrew/default.nix
@@ -2,7 +2,7 @@
imports = [
./brews.nix
./casks.nix
- ./mas.nix
+ ./mas-apps.nix
./nix-homebrew.nix
];
diff --git a/modules/mac/programs/homebrew/mas.nix b/modules/mac/programs/homebrew/mas-apps.nix
index bdbbfe4..c30aea1 100644
--- a/modules/mac/programs/homebrew/mas.nix
+++ b/modules/mac/programs/homebrew/mas-apps.nix
@@ -1,3 +1,6 @@
+# This file is generated by scripts/generate_clean_mas_apps.sh
+# Last updated: Fri Jan 3 00:39:15 PST 2025
+
{
homebrew.masApps = {
"Prime Video" = 545519333;
diff --git a/scripts/generate_clean_mas_apps.sh b/scripts/generate_clean_mas_apps.sh
index b1ea2ab..ee66d70 100755
--- a/scripts/generate_clean_mas_apps.sh
+++ b/scripts/generate_clean_mas_apps.sh
@@ -14,7 +14,7 @@ if [[ -z "${apps}" ]]; then
exit 0
fi
-output="masApps = {\n"
+output="# This file is generated by scripts/generate_clean_mas_apps.sh\n# Last updated: $(date)\n\n{\n homebrew.masApps = {\n"
while IFS= read -r line; do
app_id=$(echo "${line}" | awk '{print $1}')
@@ -25,17 +25,17 @@ while IFS= read -r line; do
sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
if [[ "${app_name}" =~ [[:space:]] ]]; then
- output+=" \"${app_name}\" = ${app_id};\n"
+ output+=" \"${app_name}\" = ${app_id};\n"
else
- output+=" ${app_name} = ${app_id};\n"
+ output+=" ${app_name} = ${app_id};\n"
fi
done <<<"${apps}"
-output+="};"
+output+=" };\n}"
# echo -e "${output}"
-output_file="mas_apps.nix"
+output_file="modules/mac/programs/homebrew/mas-apps.nix"
echo -e "${output}" >"${output_file}"
echo "write to ${output_file}"