Unverified Commit 9842ea75 authored by Yureka's avatar Yureka
Browse files

update nixpkgs with upstream matrix-alertmanager package

parent fcf03979
Pipeline #2545 passed with stages
in 30 seconds
......@@ -35,10 +35,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1ae3e34fc7b174d25eab9ee19c178699daa8ba62",
"sha256": "1q0xf4r7cxzy598pmpqyy91x2vhkf1a2drjq3bvjhmkwqh1gc23y",
"rev": "6b19a0ef8149d822c96636bf73be60b988cbf0d9",
"sha256": "1m8cxgwjrikg50wyrj8984bvhy80qf296xylrx11b40ly8yhyg0c",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/1ae3e34fc7b174d25eab9ee19c178699daa8ba62.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/6b19a0ef8149d822c96636bf73be60b988cbf0d9.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs-21.05": {
......
......@@ -7,6 +7,5 @@ let
callPackage = pkgs.lib.callPackageWith (pkgs // newpkgs);
newpkgs = {
matrix-alertmanager = callPackage ./matrix-alertmanager { };
};
in newpkgs
{ nodejs, lib, mkYarnPackage, fetchFromGitHub }:
mkYarnPackage {
src = fetchFromGitHub (lib.importJSON ./source.json);
prePatch = ''
cp ${./package.json} ./package.json
'';
postInstall = ''
sed '1 s;^;#!${nodejs}/bin/node\n;' -i $out/libexec/matrix-alertmanager/node_modules/matrix-alertmanager/src/app.js
chmod +x $out/libexec/matrix-alertmanager/node_modules/matrix-alertmanager/src/app.js
'';
yarnNix = ./yarn.nix;
yarnLock = ./yarn.lock;
packageJSON = ./package.json;
}
{
"name": "matrix-alertmanager",
"version": "0.4.0",
"dependencies": {
"dotenv": "^8.2.0",
"express": "^4.17.1",
"matrix-js-sdk": "^9.3.0",
"striptags": "^3.1.1"
},
"bin": "src/app.js"
}
{
"owner": "jaywink",
"repo": "matrix-alertmanager",
"rev": "0890394dd56deaec0e9ea1eb912d8d7588c22274",
"sha256": "13p8cbisdxjfn4s0yylnn9qwks2lkkl8far8vmlq32730i5v86i7",
"fetchSubmodules": true
}
\ No newline at end of file
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jq nix-prefetch-github yarn yarn2nix rsync nix
set -ve
cd $(dirname $0)
OWNER="jaywink"
REPO="matrix-alertmanager"
nix-prefetch-github $OWNER $REPO > source.json
src=$(nix-build .. -A matrix-alertmanager.src --no-out-link)
tmpdir="$(mktemp -d --suffix "update-matrix-alertmanager")"
trap "rm -rf ''${tmpdir};" EXIT
rsync -a "$src/" "$tmpdir/"
chmod -R u+rwX "$tmpdir"
(cd "$tmpdir" && yarn && yarn2nix > yarn.nix)
cp $tmpdir/{yarn.lock,yarn.nix} .
jq '{ name, version, dependencies, bin: .main }' $tmpdir/package.json > package.json
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment