# run the package from the repository
nix run .#
# build the package
nix build .#
# create virtual environment
python3 -m venv .venv
# use virtual environment
source .venv/bin/activate
# install dependencies from requirements.txt
pip3 install -r requirements.txt
# install package in development mode (changes will take effect automatically)
pip install -e .
export TOKEN="<your-API-token>"
- Add this repository to your
flake.nix
:
{
inputs.discord-bot-valorant = {
url = "github:make-or-break/valorant-discord-bot";
inputs = {
# use the nixpkgs defined in this flake!
# python3Packages.requests is currently broken!
# nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
}
- Enable the service in your configuration:
{ discord-bot-valorant, ... }: {
imports = [ discord-bot-valorant.nixosModules.default ];
services.valorant-discord-bot = {
enable = true;
user = "valorant-discord-bot";
group = "valorant-discord-bot";
dataDir = "/var/lib/valorant-discord-bot";
envfile = "/var/src/secrets/valorant-discord-bot/envfile";
};
}
- Create & fill up the Envfile:
sudo mkdir -p /var/src/secrets/valorant-discord-bot
sudo touch /var/src/secrets/valorant-discord-bot/envfile
sudo nano /var/src/secrets/valorant-discord-bot/envfile