diff options
| author | Fuwn <[email protected]> | 2025-01-03 00:39:47 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-01-03 00:39:47 -0800 |
| commit | 0037d96d3748c91d94e4b0081cf94094585f15ac (patch) | |
| tree | d9d577a0eb2e90f576010efa0c015b343e4d61cf | |
| parent | nara: add new mas apps (diff) | |
| download | nixos-config-0037d96d3748c91d94e4b0081cf94094585f15ac.tar.xz nixos-config-0037d96d3748c91d94e4b0081cf94094585f15ac.zip | |
nara: automate mas apps generator script
| -rw-r--r-- | modules/mac/programs/homebrew/default.nix | 2 | ||||
| -rw-r--r-- | modules/mac/programs/homebrew/mas-apps.nix (renamed from modules/mac/programs/homebrew/mas.nix) | 3 | ||||
| -rwxr-xr-x | scripts/generate_clean_mas_apps.sh | 10 |
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}" |