nixos-configs/scopedPackages/lovelace-components/custom-sidebar/default.nix
matt1432 838df34dfb
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: rename legacyPackages to scopedPackages
2024-11-20 15:17:55 -05:00

42 lines
810 B
Nix

{
concatTextFile,
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-J4zJNWWvMK4vMZ2kVgUNbjg7n45Xlhu8EXgnhcPB5MM=";
};
passthru.update = concatTextFile {
name = "update";
files = [./update.sh];
executable = true;
destination = "/bin/update";
};
})