|
50 | 50 |
|
51 | 51 | # The geodata website is not versioned, so we use the internet archive |
52 | 52 | geodata = |
| 53 | + let |
| 54 | + inherit (sources.components.geonames) timestamp; |
| 55 | + date = |
| 56 | + "${lib.substring 0 4 timestamp}-${lib.substring 4 2 timestamp}-${lib.substring 6 2 timestamp}T" |
| 57 | + + "${lib.substring 8 2 timestamp}:${lib.substring 10 2 timestamp}:${lib.substring 12 2 timestamp}Z"; |
| 58 | + in |
53 | 59 | runCommand "immich-geodata" |
54 | 60 | { |
55 | | - outputHash = "sha256-imqSfzXaEMNo9T9tZr80sr/89n19kiFc8qwidFzRUaY="; |
| 61 | + outputHash = sources.components.geonames.hash; |
56 | 62 | outputHashMode = "recursive"; |
57 | 63 | nativeBuildInputs = [ |
58 | 64 | cacert |
|
64 | 70 | } |
65 | 71 | '' |
66 | 72 | mkdir $out |
67 | | - url="https://web.archive.org/web/20240724153050/http://download.geonames.org/export/dump" |
| 73 | + url="https://web.archive.org/web/${timestamp}/http://download.geonames.org/export/dump" |
68 | 74 | curl -Lo ./cities500.zip "$url/cities500.zip" |
69 | 75 | curl -Lo $out/admin1CodesASCII.txt "$url/admin1CodesASCII.txt" |
70 | 76 | curl -Lo $out/admin2Codes.txt "$url/admin2Codes.txt" |
71 | 77 | curl -Lo $out/ne_10m_admin_0_countries.geojson \ |
72 | | - https://raw.githubusercontent.com/nvkelso/natural-earth-vector/ca96624a56bd078437bca8184e78163e5039ad19/geojson/ne_10m_admin_0_countries.geojson |
| 78 | + https://github.com/nvkelso/natural-earth-vector/raw/ca96624a56bd078437bca8184e78163e5039ad19/geojson/ne_10m_admin_0_countries.geojson |
73 | 79 |
|
74 | 80 | unzip ./cities500.zip -d $out/ |
75 | | - echo "2024-07-24T15:30:50Z" > $out/geodata-date.txt |
| 81 | + echo "${date}" > $out/geodata-date.txt |
76 | 82 | ''; |
77 | 83 |
|
78 | 84 | src = fetchFromGitHub { |
@@ -241,7 +247,10 @@ buildNpmPackage' { |
241 | 247 | meta = { |
242 | 248 | description = "Self-hosted photo and video backup solution"; |
243 | 249 | homepage = "https://immich.app/"; |
244 | | - license = lib.licenses.agpl3Only; |
| 250 | + license = with lib.licenses; [ |
| 251 | + agpl3Only |
| 252 | + cc-by-40 # geonames |
| 253 | + ]; |
245 | 254 | maintainers = with lib.maintainers; [ |
246 | 255 | dotlambda |
247 | 256 | jvanbruegge |
|
0 commit comments