Converted to yarn
This commit is contained in:
parent
526fec467c
commit
3e2f5247a0
34
flake.lock
34
flake.lock
|
@ -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",
|
||||
|
|
67
flake.nix
67
flake.nix
|
@ -1,45 +1,38 @@
|
|||
{
|
||||
description = "PVV doorbell matrix bot";
|
||||
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... }@inputs: let
|
||||
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
|
||||
in {
|
||||
inherit inputs;
|
||||
|
||||
packages = forAllSystems (system: let
|
||||
inherit (pkgs) lib;
|
||||
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
package-json = lib.importJSON ./package.json;
|
||||
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 {
|
||||
|
||||
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;
|
||||
packages = {
|
||||
node-modules = node-modules;
|
||||
default = frontend;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
1
result
1
result
|
@ -1 +0,0 @@
|
|||
/nix/store/4688vk323al998nig45cs94mxj5rjf9k-doorbell-matrix-bot-1.0.0
|
Loading…
Reference in New Issue