summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix34
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
+ '';
+ };
+ };
+ });
+}