File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 kernel = pkgsLinux . callPackage ./kernel.nix { } ;
88
99 versions = import ./versions.nix { inherit lib ; } ;
10+ latestVersion = builtins . head (
11+ builtins . attrNames ( lib . attrsets . filterAttrs ( v : i : i . isLatest ) versions )
12+ ) ;
1013
1114 extractor = pkgsLinux . callPackage ./extractor.nix { } ;
1215
5154{
5255 rm-emu-kernel = kernel ;
5356 rm-emu-extractor = extractor ;
54- rm-emu = allEmus . "rm-emu-3.20.0.92 " ;
57+ rm-emu = allEmus . "rm-emu-${ latestVersion } " ;
5558}
5659// allEmus
5760// allRootFs'
Original file line number Diff line number Diff line change 1+ url=$( curl --header " Memfault-Project-Key: JLPsMk3iNn9rmBptmhVq2NYtO4RaiFM7" " https://device.cloud.remarkable.com/api/v0/releases/latest?hardware_version=reMarkable2&software_type=device" | jq -r ' .artifacts[0].url' )
2+ echo " Downloading $url "
3+ curl -o $out " $url "
Original file line number Diff line number Diff line change 11{
22 lib ,
3+ stdenvNoCC ,
34 fetchurl ,
45 runCommand ,
56
1011 dosfstools ,
1112 e2fsprogs ,
1213
14+ cacert ,
15+ curl ,
16+ jq ,
17+
1318 extractor ,
1419
1520 fw_version ,
1823 extraCommands ? null ,
1924} :
2025let
21- inherit ( fw_info ) fileName fileHash ;
26+ inherit ( fw_info ) fileName fileHash isLatest ;
2227
2328 base_url = "https://updates-download.cloud.remarkable.engineering/build/reMarkable%20Device%20Beta/RM110" ; # Default URL for v2 versions
2429 base_url_v3 = "https://updates-download.cloud.remarkable.engineering/build/reMarkable%20Device/reMarkable2" ;
3338 else
3439 "${ base_url } /${ fw_version } /${ fw_version } _reMarkable2-${ fileName } .signed" ;
3540
36- updateArchive = fetchurl {
37- inherit url ;
38- sha256 = fileHash ;
39- } ;
41+ updateArchive =
42+ if isLatest then
43+ stdenvNoCC . mkDerivation {
44+ name = fileName ;
45+
46+ nativeBuildInputs = [
47+ curl
48+ jq
49+ ] ;
50+ builder = ./fetch-update.sh ;
51+ SSL_CERT_FILE = "${ cacert } /etc/ssl/certs/ca-bundle.crt" ;
52+
53+ outputHashAlgo = "sha256" ;
54+ outputHashMode = "flat" ;
55+ outputHash = fileHash ;
56+ }
57+ else
58+ fetchurl {
59+ inherit url ;
60+ sha256 = fileHash ;
61+ } ;
4062
4163 rootfsImageOld = runCommand "rm-rootfs.ext4" { nativeBuildInputs = [ extractor ] ; } ''
4264 extractor ${ updateArchive } $out
Original file line number Diff line number Diff line change 1212builtins . mapAttrs ( version : info : {
1313 fileName = builtins . elemAt info 0 ;
1414 fileHash = builtins . elemAt info 1 ;
15+ isLatest = false ;
1516} ) codexUpdateData . remarkable2
17+ // {
18+ "3.22.0.64" = {
19+ isLatest = true ;
20+ fileName = "remarkable-production-image-3.22.0.64-rm2-public.swu" ;
21+ fileHash = "sha256-NmLn8Ogn1jHJmoRHA4//dxC20shAScpNBhYmd/Gxqoo=" ;
22+ } ;
23+ }
You can’t perform that action at this time.
0 commit comments