{ outputs = { nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; cesspool = pkgs.rustPlatform.buildRustPackage { pname = "cesspool"; version = "0.1.0"; cargoLock.lockFile = ./Cargo.lock; src = ./.; }; in { defaultPackage = cesspool; packages.cesspool = cesspool; nixosModule = { config, lib, ... }: { options.services.cesspool = { enable = lib.mkEnableOption "Enables cesspool, a Discord thread unarchivization notifier."; tokenPath = lib.mkOption { type = lib.types.path; }; }; config.systemd.services.cesspool = with config.services.cesspool; { inherit enable; description = "Discord bot that notifies when threads are unarchived"; wantedBy = [ "multi-user.target" ]; wants = [ "network-online.target" ]; script = '' export CESSPOOL_TOKEN=$(cat ${tokenPath}) ${cesspool}/bin/cesspool ''; }; }; }); }