doorbell-matrix-bot/flake.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

2024-08-16 19:37:58 +02:00
{
description = "PVV doorbell matrix bot";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, ... }@inputs: let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
inherit inputs;
packages = forAllSystems (system: let
inherit (pkgs) lib;
pkgs = nixpkgs.legacyPackages.${system};
package-json = lib.importJSON ./package.json;
in {
default = pkgs.buildNpmPackage {
pname = package-json.name;
version = package-json.version;
meta.homepage = package-json.repository.url;
meta.license = lib.getLicenseFromSpdxId package-json.license;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.difference ./. (lib.fileset.unions [
./flake.nix
./flake.lock
]);
};
npmDepsHash = "sha256-UNc902yMkoWfpun1RrLYlEtOXcFd7uxlwKFWoM0/nTE=";
postInstall = ''
ln -vs /run/secrets/pvv-doorbell-config.json $out/lib/node_modules/$pname/config.json
'';
dontNpmBuild = true;
};
});
};
}