|
5 | 5 | { pkgs, lib }:
|
6 | 6 |
|
7 | 7 | let
|
| 8 | + inherit (pkgs.stdenv) isDarwin isLinux isi686 isx86_64 isAarch32 isAarch64; |
8 | 9 | vscode-utils = pkgs.vscode-utils;
|
9 | 10 | in
|
10 | 11 | {
|
|
30 | 31 | {%- for item in extensions %}
|
31 | 32 | {%- if item.asset_url == None %}
|
32 | 33 | {%- with uniqueId = [ item.publisher_name | to_string, '.', item.extension_name | to_string ] | join %}
|
| 34 | + {%- if is_universal(item.target_platform) %} |
33 | 35 | {{ uniqueId }} = vscode-utils.extensionFromVscodeMarketplace {
|
34 | 36 | name = "{{ item.extension_name }}";
|
35 | 37 | publisher = "{{ item.publisher_name }}";
|
36 | 38 | version = "{{ item.extension_version }}";
|
37 | 39 | sha256 = "{{ item.sha256 }}";
|
38 | 40 | };
|
| 41 | + {%- endif %} |
| 42 | + {%- endwith %} |
| 43 | + {%- endif %} |
| 44 | + {%- endfor %} |
| 45 | +}// |
| 46 | +lib.attrsets.optionalAttrs(isLinux && (isi686 || isx86_64) ){ |
| 47 | + {%- for item in extensions %} |
| 48 | + {%- if item.asset_url == None %} |
| 49 | + {%- with uniqueId = [ item.publisher_name | to_string, '.', item.extension_name | to_string ] | join %} |
| 50 | + {%- if is_linux_x86(item.target_platform) %} |
| 51 | + {{ uniqueId }} = vscode-utils.extensionFromVscodeMarketplace { |
| 52 | + name = "{{ item.extension_name }}"; |
| 53 | + publisher = "{{ item.publisher_name }}"; |
| 54 | + version = "{{ item.extension_version }}"; |
| 55 | + sha256 = "{{ item.sha256 }}"; |
| 56 | + arch = "linux-x64"; |
| 57 | + }; |
| 58 | + {%- endif %} |
| 59 | + {%- endwith %} |
| 60 | + {%- endif %} |
| 61 | + {%- endfor %} |
| 62 | +}// |
| 63 | +lib.attrsets.optionalAttrs(isLinux && (isAarch32 || isAarch64) ){ |
| 64 | + {%- for item in extensions %} |
| 65 | + {%- if item.asset_url == None %} |
| 66 | + {%- with uniqueId = [ item.publisher_name | to_string, '.', item.extension_name | to_string ] | join %} |
| 67 | + {%- if is_linux_arm(item.target_platform) %} |
| 68 | + {{ uniqueId }} = vscode-utils.extensionFromVscodeMarketplace { |
| 69 | + name = "{{ item.extension_name }}"; |
| 70 | + publisher = "{{ item.publisher_name }}"; |
| 71 | + version = "{{ item.extension_version }}"; |
| 72 | + sha256 = "{{ item.sha256 }}"; |
| 73 | + arch = "linux-arm64"; |
| 74 | + }; |
| 75 | + {%- endif %} |
| 76 | + {%- endwith %} |
| 77 | + {%- endif %} |
| 78 | + {%- endfor %} |
| 79 | +}// |
| 80 | +lib.attrsets.optionalAttrs(isDarwin && (isi686 || isx86_64) ){ |
| 81 | + {%- for item in extensions %} |
| 82 | + {%- if item.asset_url == None %} |
| 83 | + {%- with uniqueId = [ item.publisher_name | to_string, '.', item.extension_name | to_string ] | join %} |
| 84 | + {%- if is_darwin_x86(item.target_platform) %} |
| 85 | + {{ uniqueId }} = vscode-utils.extensionFromVscodeMarketplace { |
| 86 | + name = "{{ item.extension_name }}"; |
| 87 | + publisher = "{{ item.publisher_name }}"; |
| 88 | + version = "{{ item.extension_version }}"; |
| 89 | + sha256 = "{{ item.sha256 }}"; |
| 90 | + arch = "darwin-x64"; |
| 91 | + }; |
| 92 | + {%- endif %} |
| 93 | + {%- endwith %} |
| 94 | + {%- endif %} |
| 95 | + {%- endfor %} |
| 96 | +}// |
| 97 | +lib.attrsets.optionalAttrs(isDarwin && (isAarch32 || isAarch64) ){ |
| 98 | + {%- for item in extensions %} |
| 99 | + {%- if item.asset_url == None %} |
| 100 | + {%- with uniqueId = [ item.publisher_name | to_string, '.', item.extension_name | to_string ] | join %} |
| 101 | + {%- if is_darwin_arm(item.target_platform) %} |
| 102 | + {{ uniqueId }} = vscode-utils.extensionFromVscodeMarketplace { |
| 103 | + name = "{{ item.extension_name }}"; |
| 104 | + publisher = "{{ item.publisher_name }}"; |
| 105 | + version = "{{ item.extension_version }}"; |
| 106 | + sha256 = "{{ item.sha256 }}"; |
| 107 | + arch = "darwin-arm64"; |
| 108 | + }; |
| 109 | + {%- endif %} |
39 | 110 | {%- endwith %}
|
40 | 111 | {%- endif %}
|
41 | 112 | {%- endfor %}
|
|
0 commit comments