Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Contributing

Develop

Nix

nix develop
Nix files

default.nix

{
    stdenv,
    cargo,
    rustc,
    rustfmt,
    pkg-config,
    openssl,
    mdbook,
    mdbook-admonish,
}:


stdenv.mkDerivation {
  pname = "quantum";
  version = "6.x.x";

  src = ./.;

  nativeBuildInputs = [
    mdbook
    mdbook-admonish

    cargo
    rustc
    rustfmt

    pkg-config
    openssl.dev
  ];
}

flake.nix

{

inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
};


outputs = {
  self,
  nixpkgs,
  flake-utils,
}:


flake-utils.lib.eachDefaultSystem (system:

    let
        pkgs = nixpkgs.legacyPackages.${system};
        quantum = pkgs.callPackage ./default.nix { };

    in {
        packages = {
            inherit quantum;
            default = quantum;
        };

        devShells = {
            default = pkgs.mkShell { inputsFrom = [ quantum ]; };
        };
    }
);


}

Manually

todo

Building

cargo build

This will also build gRPC files in src/youtube/proto/
Should be handeld automatically by prost (build.rs)

Running

# Will need a better solution, but don't really wanna use `dotenv` crate
(source .env && DISCORD_TOKEN_DEV="$DISCORD_TOKEN_DEV" YOUTUBE_TOKEN="$YOUTUBE_TOKEN" ./target/debug/quantum)

Notes

If built in release mode, it uses DISCORD_TOKEN_RELEASE
If built in debug mode, it uses DISCORD_TOKEN_DEV

Deployement should be fully automatic (both bot and docs by Github Actions)