doorbell-matrix-bot/flake.nix

39 lines
991 B
Nix
Raw Normal View History

2024-08-16 19:37:58 +02:00
{
description = "PVV doorbell matrix bot";
2024-09-14 23:28:48 +02:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
2024-08-16 19:37:58 +02:00
2024-09-14 23:28:48 +02:00
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
node-modules = pkgs.mkYarnPackage {
name = "node-modules";
src = ./.;
2024-08-16 19:37:58 +02:00
};
2024-09-14 23:28:48 +02:00
frontend = pkgs.stdenv.mkDerivation {
name = "frontend";
src = ./.;
buildInputs = [pkgs.yarn node-modules];
buildPhase = ''
ln -s ${node-modules}/libexec/pvv-doorbell-bot/node_modules node_modules
${pkgs.yarn}/bin/yarn build
'';
installPhase = ''
mkdir $out
mv dist $out/lib
'';
};
in {
packages = {
node-modules = node-modules;
default = frontend;
};
}
);
2024-08-16 19:37:58 +02:00
}
2024-09-14 23:28:48 +02:00