Skip to content

Commit 1cb8c62

Browse files
committed
the app runs now
1 parent 71471d9 commit 1cb8c62

File tree

5 files changed

+545
-271
lines changed

5 files changed

+545
-271
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ lerna-debug.log
1414
.tmp/
1515
.wrangler/
1616
.direnv/
17+
result

flake.nix

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929

3030
in
3131
rec {
32-
# 'rec' allows self-reference if needed, e.g., devShells = devShell;
33-
34-
# This will create devShell.x86_64-linux, devShell.aarch64-linux, etc.
35-
# `nix develop` on a supported system (e.g., x86_64-linux) will pick up
36-
# devShell.x86_64-linux automatically.
3732
devShell = forAllSystems (
3833
pkgs:
3934
pkgs.mkShell {
@@ -57,16 +52,28 @@
5752

5853
devShells = devShell;
5954

60-
# If you had other outputs like packages or apps, they would go here:
61-
# packages = forAllSystems (pkgs: {
62-
# default = pkgs.hello; # Example
63-
# });
64-
#
65-
# apps = forAllSystems (pkgs: {
66-
# default = {
67-
# type = "app";
68-
# program = "${self.packages.${pkgs.system}.default}/bin/hello";
69-
# };
70-
# });
55+
packages = forAllSystems (pkgs: {
56+
default = pkgs.buildNpmPackage {
57+
name = "cf-workers-telegram-bot";
58+
src = ./.;
59+
npmDepsHash = "sha256-tlxWjtGMnTTMS4or/hZuWEoe+DI6eZRHbOKLsXx/LIY=";
60+
installPhase = ''
61+
runHook preInstall
62+
mkdir -p $out
63+
cp -r dist/* $out/
64+
runHook postInstall
65+
'';
66+
};
67+
});
68+
69+
apps = forAllSystems (pkgs: {
70+
default = {
71+
type = "app";
72+
program = "${pkgs.writeScriptBin "run-worker" ''
73+
#!/bin/sh
74+
${pkgs.nodejs_latest}/bin/node ${self.packages.${pkgs.system}.default}/worker.js "$@"
75+
''}/bin/run-worker";
76+
};
77+
});
7178
};
7279
}

0 commit comments

Comments
 (0)