blob: ab6e81837cc68a0b63a7483e38836a12aaae20d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
{
pkgs,
lib,
...
}:
let
extensions = import ../../../modules/web/chromium/extensions/metadata.nix;
luaExtensionList = lib.concatMapStringsSep "\n" (ext: ''
{ pname = "${ext.pname}", owner = "${ext.owner}", repo = "${ext.repo}", version = "${ext.version}", updateType = "${ext.updateType or "release"}", tagPrefix = "${ext.tagPrefix}" },
'') extensions;
luaScript = pkgs.writeText "check-chromium-extension-updates.lua" (
builtins.replaceStrings [ "--@@EXTENSIONS@@--" ] [ luaExtensionList ] (
builtins.readFile ./check-chromium-extension-updates.lua
)
);
in
{
mkUpdateScript = pkgs.stdenv.mkDerivation {
pname = "check-chromium-extension-updates";
version = "0.1.0";
dontUnpack = true;
nativeBuildInputs = [
pkgs.luajit
pkgs.makeWrapper
];
installPhase = ''
mkdir -p $out/bin
install -m755 ${luaScript} $out/bin/check-chromium-extension-updates
patchShebangs $out/bin/check-chromium-extension-updates
wrapProgram $out/bin/check-chromium-extension-updates \
--prefix PATH : "${
lib.makeBinPath [
pkgs.curl
pkgs.jq
]
}"
'';
meta = {
mainProgram = "check-chromium-extension-updates";
};
};
}
|