feat: reorganize with remote
This commit is contained in:
parent
a74e5753fa
commit
dc7b8cbadd
28 changed files with 622 additions and 3024 deletions
|
|
@ -1,9 +1,9 @@
|
|||
self:
|
||||
pkg:
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.noisebell-rss;
|
||||
bin = "${self.packages.x86_64-linux.default}/bin/noisebell-rss";
|
||||
bin = "${pkg}/bin/noisebell-rss";
|
||||
in
|
||||
{
|
||||
options.services.noisebell-rss = {
|
||||
|
|
@ -19,14 +19,9 @@ in
|
|||
default = 3002;
|
||||
};
|
||||
|
||||
webhookSecretFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Path to file containing the webhook secret.";
|
||||
};
|
||||
|
||||
dataDir = lib.mkOption {
|
||||
cacheUrl = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/var/lib/noisebell-rss";
|
||||
description = "URL of the cache service (e.g. http://localhost:3000).";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -44,16 +39,15 @@ in
|
|||
systemd.services.noisebell-rss = {
|
||||
description = "Noisebell RSS/Atom feed";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
after = [ "network-online.target" "noisebell-cache.service" ];
|
||||
wants = [ "network-online.target" ];
|
||||
environment = {
|
||||
NOISEBELL_RSS_PORT = toString cfg.port;
|
||||
NOISEBELL_RSS_DATA_DIR = cfg.dataDir;
|
||||
NOISEBELL_RSS_CACHE_URL = cfg.cacheUrl;
|
||||
NOISEBELL_RSS_SITE_URL = "https://${cfg.domain}";
|
||||
RUST_LOG = "info";
|
||||
};
|
||||
script = ''
|
||||
export NOISEBELL_RSS_WEBHOOK_SECRET="$(cat ${cfg.webhookSecretFile})"
|
||||
exec ${bin}
|
||||
'';
|
||||
serviceConfig = {
|
||||
|
|
@ -62,7 +56,6 @@ in
|
|||
RestartSec = 5;
|
||||
User = "noisebell-rss";
|
||||
Group = "noisebell-rss";
|
||||
StateDirectory = "noisebell-rss";
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
|
|
@ -71,7 +64,6 @@ in
|
|||
ProtectKernelModules = true;
|
||||
ProtectControlGroups = true;
|
||||
RestrictSUIDSGID = true;
|
||||
ReadWritePaths = [ cfg.dataDir ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue