Adding project
This commit is contained in:
commit
3bd18050cb
9 files changed
+730
No files matched your search
@@ -0,0 +1,32 @@
|
||||
{
|
||||
description = "Alabama Progress Discord bot";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
python = pkgs.python3.withPackages (ps: [ ps.discordpy ]);
|
||||
in {
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages = [ python pkgs.ruff ];
|
||||
|
||||
shellHook = ''
|
||||
secrets=/var/lib/secrets
|
||||
|
||||
if [ -r "$secrets/discord_token" ]; then
|
||||
export DISCORD_BOT_TOKEN="$(cat "$secrets/discord_token")"
|
||||
else
|
||||
echo "warning: cannot read $secrets/discord_token" >&2
|
||||
fi
|
||||
|
||||
if [ -r "$secrets/discord_guild_id" ]; then
|
||||
export DISCORD_GUILD_ID="$(cat "$secrets/discord_guild_id")"
|
||||
else
|
||||
echo "warning: cannot read $secrets/discord_guild_id" >&2
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user