diff options
| author | uakci <uakci@uakci.pl> | 2022-09-30 16:43:03 +0200 |
|---|---|---|
| committer | uakci <uakci@uakci.pl> | 2022-09-30 17:13:13 +0200 |
| commit | 5318d2fbc20101212bbb5ba35b605142a00aef4a (patch) | |
| tree | d9a9a001ba70598d05b6dbdce4ccafe96a9e39ce /flake.nix | |
| download | cesspool-main.tar.gz cesspool-main.zip | |
Diffstat (limited to '')
| -rw-r--r-- | flake.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..df77653 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + 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 + ''; + }; + }; + }); +} |
