nixos-configs/legacyPackages/lovelace-components/custom-sidebar/default.nix
matt1432 e47f6ea0d7
All checks were successful
Discord / discord commits (push) Has been skipped
feat(hass): setup custom-sidebar
2024-10-16 20:12:27 -04:00

34 lines
633 B
Nix

{
custom-sidebar-src,
nodejs,
pnpm,
stdenv,
...
}: let
package = builtins.fromJSON (builtins.readFile "${custom-sidebar-src}/package.json");
in
stdenv.mkDerivation (finalAttrs: {
pname = "custom-sidebar";
inherit (package) version;
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-oERAaN/0uyImDRlxJIdKutFh3jYFJQh2KAeM1LXBpjU=";
};
})