51 lines
1 KiB
Nix
51 lines
1 KiB
Nix
{
|
|
# nix build inputs
|
|
lib,
|
|
stdenv,
|
|
concatTextFile,
|
|
custom-sidebar-src,
|
|
# deps
|
|
nodejs,
|
|
pnpm,
|
|
...
|
|
}: let
|
|
inherit (builtins) fromJSON readFile;
|
|
|
|
package = fromJSON (readFile "${custom-sidebar-src}/package.json");
|
|
in
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "custom-sidebar";
|
|
version = "${package.version}+${custom-sidebar-src.shortRev}";
|
|
|
|
src = custom-sidebar-src;
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
pnpm.configHook
|
|
];
|
|
|
|
buildPhase = ''
|
|
npm run build
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir $out
|
|
cp ./dist/* $out
|
|
'';
|
|
|
|
pnpmDeps = pnpm.fetchDeps {
|
|
inherit (finalAttrs) pname version src;
|
|
hash = "sha256-Nuig5vUC0UBic2MK2MNac0iD6N1ZaHZCuolQKVCVWDU=";
|
|
};
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
meta = {
|
|
license = lib.licenses.asl20;
|
|
homepage = "https://github.com/elchininet/custom-sidebar";
|
|
description = ''
|
|
Custom HACS plugin that allows you to personalise the
|
|
Home Assistant's sidebar per user or device basis.
|
|
'';
|
|
};
|
|
})
|