uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
73
pkgs/servers/web-apps/plausible/default.nix
Normal file
73
pkgs/servers/web-apps/plausible/default.nix
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, beamPackages
|
||||
, fetchFromGitHub
|
||||
, glibcLocales
|
||||
, cacert
|
||||
, mkYarnModules
|
||||
, fetchYarnDeps
|
||||
, nodejs
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "plausible";
|
||||
version = "1.4.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "plausible";
|
||||
repo = "analytics";
|
||||
rev = "v${version}";
|
||||
sha256 = "1ckw5cd4z96jkjhmzjq7k3kzjj7bvj38i5xq9r43cz0sn7w3470k";
|
||||
};
|
||||
|
||||
# TODO consider using `mix2nix` as soon as it supports git dependencies.
|
||||
mixFodDeps = beamPackages.fetchMixDeps {
|
||||
pname = "${pname}-deps";
|
||||
inherit src version;
|
||||
sha256 = "1ikcskp4gvvdprl65x1spijdc8dz6klnrnkvgy2jbk0b3d7yn1v5";
|
||||
};
|
||||
|
||||
yarnDeps = mkYarnModules {
|
||||
pname = "${pname}-yarn-deps";
|
||||
inherit version;
|
||||
packageJSON = ./package.json;
|
||||
yarnLock = ./yarn.lock;
|
||||
yarnNix = ./yarn.nix;
|
||||
preBuild = ''
|
||||
mkdir -p tmp/deps
|
||||
cp -r ${mixFodDeps}/phoenix tmp/deps/phoenix
|
||||
cp -r ${mixFodDeps}/phoenix_html tmp/deps/phoenix_html
|
||||
'';
|
||||
postBuild = ''
|
||||
echo 'module.exports = {}' > $out/node_modules/flatpickr/dist/postcss.config.js
|
||||
'';
|
||||
};
|
||||
in
|
||||
beamPackages.mixRelease {
|
||||
inherit pname version src mixFodDeps;
|
||||
|
||||
nativeBuildInputs = [ nodejs ];
|
||||
|
||||
passthru = {
|
||||
tests = { inherit (nixosTests) plausible; };
|
||||
updateScript = ./update.sh;
|
||||
};
|
||||
|
||||
postBuild = ''
|
||||
ln -sf ${yarnDeps}/node_modules assets/node_modules
|
||||
npm run deploy --prefix ./assets
|
||||
|
||||
# for external task you need a workaround for the no deps check flag
|
||||
# https://github.com/phoenixframework/phoenix/issues/2690
|
||||
mix do deps.loadpaths --no-deps-check, phx.digest
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
license = licenses.agpl3Plus;
|
||||
homepage = "https://plausible.io/";
|
||||
description = " Simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.";
|
||||
maintainers = with maintainers; [ ma27 ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
68
pkgs/servers/web-apps/plausible/package.json
Normal file
68
pkgs/servers/web-apps/plausible/package.json
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"repository": {},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"deploy": "$(npm bin)/webpack --mode production",
|
||||
"watch": "$(npm bin)/webpack --mode development --watch",
|
||||
"format": "$(npm bin)/prettier --write {css,js}/**",
|
||||
"check-format": "$(npm bin)/prettier --check {css,js}/**",
|
||||
"lint": "$(npm bin)/eslint js/**"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.14.3",
|
||||
"@babel/preset-env": "^7.14.4",
|
||||
"@babel/preset-react": "^7.13.13",
|
||||
"@headlessui/react": "^1.3.0",
|
||||
"@heroicons/react": "^1.0.1",
|
||||
"@juggle/resize-observer": "^3.3.1",
|
||||
"@kunukn/react-collapse": "^2.2.9",
|
||||
"@tailwindcss/aspect-ratio": "^0.2.1",
|
||||
"@tailwindcss/forms": "^0.3.2",
|
||||
"@tailwindcss/typography": "^0.4.1",
|
||||
"abortcontroller-polyfill": "^1.7.3",
|
||||
"alpinejs": "^2.8.2",
|
||||
"autoprefixer": "^10.2.6",
|
||||
"babel-loader": "^8.2.2",
|
||||
"chart.js": "^3.3.2",
|
||||
"classnames": "^2.3.1",
|
||||
"copy-webpack-plugin": "^9.0.0",
|
||||
"css-loader": "^5.2.6",
|
||||
"css-minimizer-webpack-plugin": "^3.0.1",
|
||||
"datamaps": "^0.5.9",
|
||||
"debounce-promise": "^3.1.2",
|
||||
"downshift": "^6.1.3",
|
||||
"iframe-resizer": "^4.3.2",
|
||||
"mini-css-extract-plugin": "^1.6.0",
|
||||
"phoenix": "file:../../tmp/deps/phoenix",
|
||||
"phoenix_html": "file:../../tmp/deps/phoenix_html",
|
||||
"postcss": "^8.3.0",
|
||||
"postcss-loader": "^6.1.1",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-flatpickr": "3.10.5",
|
||||
"react-flip-move": "^3.0.4",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-transition-group": "^4.4.2",
|
||||
"tailwindcss": "^2.1.2",
|
||||
"terser-webpack-plugin": "^5.1.2",
|
||||
"url-search-params-polyfill": "^8.1.1",
|
||||
"webpack": "5.38.1",
|
||||
"webpack-cli": "^4.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^7.2.0",
|
||||
"eslint-config-prettier": "^7.0.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.4.1",
|
||||
"eslint-plugin-prettier": "^3.3.0",
|
||||
"eslint-plugin-react": "^7.21.5",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"stylelint": "^13.8.0",
|
||||
"stylelint-config-prettier": "^8.0.2",
|
||||
"stylelint-config-standard": "^20.0.0",
|
||||
"webpack-bundle-analyzer": "^4.4.2"
|
||||
},
|
||||
"name": "plausible",
|
||||
"version": "v1.4.4"
|
||||
}
|
||||
62
pkgs/servers/web-apps/plausible/update.sh
Executable file
62
pkgs/servers/web-apps/plausible/update.sh
Executable file
|
|
@ -0,0 +1,62 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p jq nix-prefetch-github yarn yarn2nix-moretea.yarn2nix moreutils
|
||||
|
||||
# NOTE: please check on new releases which steps aren't necessary anymore!
|
||||
# Currently the following things are done:
|
||||
#
|
||||
# * Add correct `name`/`version` field to `package.json`, otherwise `yarn2nix` fails to
|
||||
# find required dependencies.
|
||||
# * Adjust `file:`-dependencies a bit for the structure inside a Nix build.
|
||||
# * Update hashes for the tarball & the fixed-output drv with all `mix`-dependencies.
|
||||
# * Generate `yarn.lock` & `yarn.nix` in a temporary directory.
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
dir="$(realpath $(dirname "$0"))"
|
||||
export latest="$(curl -q https://api.github.com/repos/plausible/analytics/releases/latest \
|
||||
| jq -r '.tag_name')"
|
||||
nix_version="$(cut -c2- <<< "$latest")"
|
||||
|
||||
if [[ "$(nix-instantiate -A plausible.version --eval --json | jq -r)" = "$nix_version" ]];
|
||||
then
|
||||
echo "Already using version $latest, skipping"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
SRC="https://raw.githubusercontent.com/plausible/analytics/${latest}"
|
||||
|
||||
package_json="$(curl -qf "$SRC/assets/package.json")"
|
||||
|
||||
echo "$package_json" \
|
||||
| jq '. + {"name":"plausible","version": $ENV.latest}' \
|
||||
| sed -e 's,../deps/,../../tmp/deps/,g' \
|
||||
> $dir/package.json
|
||||
|
||||
tarball_meta="$(nix-prefetch-github plausible analytics --rev "$latest")"
|
||||
tarball_hash="$(nix to-base32 sha256-$(jq -r '.sha256' <<< "$tarball_meta"))"
|
||||
tarball_path="$(nix-build -E 'with import ./. {}; { p }: fetchFromGitHub (builtins.fromJSON p)' --argstr p "$tarball_meta")"
|
||||
fake_hash="$(nix-instantiate --eval -A lib.fakeSha256 | xargs echo)"
|
||||
|
||||
sed -i "$dir/default.nix" \
|
||||
-e 's,version = ".*",version = "'"$nix_version"'",' \
|
||||
-e '/^ src = fetchFromGitHub/,+4{;s/sha256 = "\(.*\)"/sha256 = "'"$tarball_hash"'"/}' \
|
||||
-e '/^ mixFodDeps =/,+3{;s/sha256 = "\(.*\)"/sha256 = "'"$fake_hash"'"/}'
|
||||
|
||||
mix_hash="$(nix to-base32 $(nix-build -A plausible.mixFodDeps 2>&1 | tail -n3 | grep 'got:' | cut -d: -f2- | xargs echo || true))"
|
||||
|
||||
sed -i "$dir/default.nix" -e '/^ mixFodDeps =/,+3{;s/sha256 = "\(.*\)"/sha256 = "'"$mix_hash"'"/}'
|
||||
|
||||
tmp_setup_dir="$(mktemp -d)"
|
||||
trap "rm -rf $tmp_setup_dir" EXIT
|
||||
|
||||
cp -r $tarball_path/* $tmp_setup_dir/
|
||||
cp -r "$(nix-build -A plausible.mixFodDeps)" "$tmp_setup_dir/deps"
|
||||
chmod -R u+rwx "$tmp_setup_dir"
|
||||
|
||||
pushd $tmp_setup_dir/assets
|
||||
yarn
|
||||
yarn2nix > "$dir/yarn.nix"
|
||||
cp yarn.lock "$dir/yarn.lock"
|
||||
popd
|
||||
|
||||
nix-build -A plausible
|
||||
5873
pkgs/servers/web-apps/plausible/yarn.lock
Normal file
5873
pkgs/servers/web-apps/plausible/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
6438
pkgs/servers/web-apps/plausible/yarn.nix
Normal file
6438
pkgs/servers/web-apps/plausible/yarn.nix
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue