Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

derive buildDateTime from JSON contents #241

Open
Atemu opened this issue Jun 17, 2024 · 0 comments
Open

derive buildDateTime from JSON contents #241

Atemu opened this issue Jun 17, 2024 · 0 comments

Comments

@Atemu
Copy link
Contributor

Atemu commented Jun 17, 2024

Currently buildDateTime must be specified and updated separately. It's the same for all androidVersions and makes updates non-deterministic because it either updates every time an update is done or is set arbitrarily by the user to likely their current time.

To rectify this, it ought to be possible to extract the timestamps out of the version's JSON files and then take the newest.

For the repo, this is actually quite trivial as you can simply do:

  buildDateTime = lib.sort (p: q: p > q) (lib.mapAttrsToList (n: v: v.dateTime or 0) repoDirs);

For LineageOS this is a bit harder as we also have device and vendor dir sources. These do have timestamps in them too but they're in ISO8601 rather than UNIX epoch (which we need). We'd have to patch nix-prefetch-git to use unix epoch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant