nixos-configs/scopedPackages/lovelace-components/custom-sidebar/default.nix
matt1432 b611d99863
All checks were successful
Discord / discord commits (push) Has been skipped
feat(material-rounded-theme): use latest release instead of latest git
2025-02-12 00:43:27 -05:00

44 lines
869 B
Nix

{
concatTextFile,
custom-sidebar-src,
nodejs,
pnpm,
stdenv,
...
}: 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-P/jmYpkrd0U4RhHtq2GVCYwPL44h9fqv7S50Bz+TNf8=";
};
passthru.update = concatTextFile {
name = "update";
files = [./update.sh];
executable = true;
destination = "/bin/update";
};
})