mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-03 10:04:12 +02:00
use app version data from nixpkgs
This commit is contained in:
parent
cbdc59d591
commit
3daf2339f3
9 changed files with 1213 additions and 223 deletions
354
nix/app-versions/29.json
Normal file
354
nix/app-versions/29.json
Normal file
File diff suppressed because one or more lines are too long
386
nix/app-versions/30.json
Normal file
386
nix/app-versions/30.json
Normal file
File diff suppressed because one or more lines are too long
386
nix/app-versions/31.json
Normal file
386
nix/app-versions/31.json
Normal file
File diff suppressed because one or more lines are too long
2
nix/app-versions/README.md
Normal file
2
nix/app-versions/README.md
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Copied from
|
||||
[nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/nextcloud/packages/)
|
||||
27
nix/app-versions/default.nix
Normal file
27
nix/app-versions/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
lib: let
|
||||
inherit (builtins) splitVersion head fromJSON readFile mapAttrs map listToAttrs foldl' attrNames;
|
||||
inherit (lib) unique;
|
||||
ncVersions = ["29" "30" "31"];
|
||||
|
||||
getMajorVersion = version: head (splitVersion version);
|
||||
|
||||
readJSON = path: fromJSON (readFile path);
|
||||
|
||||
getVersionData = data: {
|
||||
inherit (data) url version;
|
||||
sha256 = data.hash;
|
||||
};
|
||||
getByNcVersion = ncVersion: mapAttrs (app: data: {"${getMajorVersion data.version}" = getVersionData data;}) (readJSON ./${ncVersion}.json);
|
||||
|
||||
byNcVersion = map getByNcVersion ncVersions;
|
||||
mergeVersions = a: b: let
|
||||
allApps = unique (attrNames a ++ attrNames b);
|
||||
mergeApp = app: (a.${app} or {}) // (b.${app} or {});
|
||||
in
|
||||
listToAttrs (map (app: {
|
||||
name = app;
|
||||
value = mergeApp app;
|
||||
})
|
||||
allApps);
|
||||
in
|
||||
foldl' (acc: apps: mergeVersions acc apps) {} byNcVersion
|
||||
Loading…
Add table
Add a link
Reference in a new issue