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