Converted to yarn

This commit is contained in:
Adrian Gunnar Lauterer 2024-09-14 23:28:48 +02:00
parent 526fec467c
commit 3e2f5247a0
5 changed files with 1334 additions and 1896 deletions

34
flake.lock generated
View File

@ -1,5 +1,23 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1723637854,
@ -18,8 +36,24 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@ -1,45 +1,38 @@
{
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 [
./module.nix
./flake.lock
./flake.nix
]);
};
npmDepsHash = "sha256-518ln/eAlgnKcubOTquBP8gj9Q/lT5bhpJGWOeuUKmY=";
dontNpmBuild = true;
};
});
overlays = forAllSystems (system: {
default = prevPackages: finalPackages: {
pvv-doorbell-bot = self.packages.${system}.default;
};
});
nixosModules.default = import ./module.nix;
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
node-modules = pkgs.mkYarnPackage {
name = "node-modules";
src = ./.;
};
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;
};
}
);
}

1855
package-lock.json generated

File diff suppressed because it is too large Load Diff

1
result
View File

@ -1 +0,0 @@
/nix/store/4688vk323al998nig45cs94mxj5rjf9k-doorbell-matrix-bot-1.0.0

1267
yarn.lock Normal file

File diff suppressed because it is too large Load Diff