Console Script Application
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
outputs = { self, nixpkgs, handyhelper }: let
|
outputs = { self, nixpkgs, handyhelper }: let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
handy_py = handyhelper.packages.${system}.handyhelper_pkg;
|
handy_py = handyhelper.packages.${system}.handyhelper;
|
||||||
in {
|
in {
|
||||||
nixosConfigurations."staging" = nixpkgs.lib.nixosSystem {
|
nixosConfigurations."staging" = nixpkgs.lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
@@ -16,13 +16,9 @@
|
|||||||
wantedBy = ["networking-online.target"];
|
wantedBy = ["networking-online.target"];
|
||||||
enable = true;
|
enable = true;
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = let
|
ExecStart = ''
|
||||||
python = pkgs.python3.withPackages (p: with p; [
|
${handy_py}/bin/handyhelper
|
||||||
handy_py
|
'';
|
||||||
openai
|
|
||||||
]);
|
|
||||||
in
|
|
||||||
"${python.interpreter} -m handyhelper";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
handyhelper = pkgs.runCommand "Handy Helper Deploy" {
|
handyhelper = pkgs.runCommand "Handy Helper Deploy" {
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
packages.handyhelper_pkg
|
packages.handyhelper
|
||||||
];
|
];
|
||||||
} ''
|
} ''
|
||||||
cat << 'DOC' >> $out
|
cat << 'DOC' >> $out
|
||||||
@@ -46,7 +46,6 @@ DOC
|
|||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
handyhelper = mkPoetryApplication { projectDir = self; };
|
handyhelper = mkPoetryApplication { projectDir = self; };
|
||||||
handyhelper_pkg = mkPoetryPackages { projectDir = self; };
|
|
||||||
default = self.packages.${system}.handyhelper;
|
default = self.packages.${system}.handyhelper;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
# Handle major modules of package
|
# Handle major modules of package
|
||||||
|
import * from ./__main__
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ async def summarize(
|
|||||||
):
|
):
|
||||||
print("Will summarize article.")
|
print("Will summarize article.")
|
||||||
|
|
||||||
# TODO: Import bot token from env
|
def main():
|
||||||
bot.run(os.environ["DISCORD_TOKEN"],)
|
# TODO: Import bot token from env
|
||||||
|
bot.run(os.environ["DISCORD_TOKEN"])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print("Handy Helper has Begun!")
|
print("Handy Helper has Begun!")
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ authors = ["David Crompton"]
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
|
[tool.poetry.scripts]
|
||||||
|
handyhelper = "handyhelper:main"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.10"
|
python = "^3.10"
|
||||||
requests = "^2.28.2"
|
requests = "^2.28.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user