This commit is contained in:
Robin Appelman 2025-06-02 21:21:11 +02:00
commit a3818da108
6 changed files with 42 additions and 41 deletions

View file

@ -4,8 +4,8 @@ Trigger webhooks from rss/atom feeds.
Send a `POST` request to a webhook every time an rss/atom feed changes.
Note that this will only detect changes made while the program is running, it is not able to detect changes made to
the feeds on program start.
Note that this will only detect changes made while the program is running, it is
not able to detect changes made to the feeds on program start.
### Configuration

View file

@ -1,6 +1,6 @@
{ dockerTools
, rss-webhook-trigger
,
{
dockerTools,
rss-webhook-trigger,
}:
dockerTools.buildLayeredImage {
name = "icewind1991/rss-webhook-trigger";
@ -11,6 +11,6 @@ dockerTools.buildLayeredImage {
dockerTools.caCertificates
];
config = {
Cmd = [ "rss-webhook-trigger" ];
Cmd = ["rss-webhook-trigger"];
};
}

View file

@ -10,20 +10,21 @@
inputs.flakelight.follows = "flakelight";
};
};
outputs = { mill-scale, ... }: mill-scale ./. {
nixosModules = { outputs, ... }: {
default =
{ pkgs
, config
, lib
, ...
outputs = {mill-scale, ...}:
mill-scale ./. {
nixosModules = {outputs, ...}: {
default = {
pkgs,
config,
lib,
...
}: {
imports = [ ./nix/module.nix ];
imports = [./nix/module.nix];
config = lib.mkIf config.services.rss-webhook-trigger.enable {
nixpkgs.overlays = [ outputs.overlays.default ];
nixpkgs.overlays = [outputs.overlays.default];
services.rss-webhook-trigger.package = lib.mkDefault pkgs.rss-webhook-trigger;
};
};
};
};
};
}

View file

@ -1,16 +1,16 @@
{ config
, lib
, pkgs
, ...
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.rss-webhook-trigger;
format = pkgs.formats.toml { };
format = pkgs.formats.toml {};
configFile = format.generate "trigger.toml" {
feed = cfg.hooks;
};
in
{
in {
options.services.rss-webhook-trigger = {
enable = mkEnableOption "Enables the rss-webhook-trigger service";
@ -28,12 +28,12 @@ in
};
headers = mkOption {
type = types.attrs;
default = { };
default = {};
description = "headers to send";
};
body = mkOption {
type = types.attrs;
default = { };
default = {};
description = "body to send";
};
};
@ -54,7 +54,7 @@ in
config = mkIf cfg.enable {
systemd.services."rss-webhook-trigger" = {
wantedBy = [ "multi-user.target" ];
wantedBy = ["multi-user.target"];
environment = {
RUST_LOG = cfg.log;
@ -83,7 +83,7 @@ in
RestrictAddressFamilies = "AF_INET AF_INET6";
RestrictRealtime = true;
ProtectProc = "noaccess";
SystemCallFilter = [ "@system-service" "~@resources" "~@privileged" ];
SystemCallFilter = ["@system-service" "~@resources" "~@privileged"];
IPAddressDeny = "localhost link-local multicast";
};
};

View file

@ -1,3 +1,3 @@
final: prev: {
rss-webhook-trigger = final.callPackage ./package.nix { };
rss-webhook-trigger = final.callPackage ./package.nix {};
}

View file

@ -1,19 +1,19 @@
{ rustPlatform
, lib
}:
let
{
rustPlatform,
lib,
}: let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. [ "Cargo.*" "(src)(/.*)?" ];
src = sourceByRegex ../. ["Cargo.*" "(src)(/.*)?"];
cargoPackage = (fromTOML (readFile ../Cargo.toml)).package;
in
rustPlatform.buildRustPackage rec {
inherit (cargoPackage) version;
pname = cargoPackage.name;
rustPlatform.buildRustPackage rec {
inherit (cargoPackage) version;
pname = cargoPackage.name;
inherit src;
inherit src;
cargoLock = {
lockFile = ../Cargo.lock;
};
}
cargoLock = {
lockFile = ../Cargo.lock;
};
}