feat: format and fix noisebell config
This commit is contained in:
parent
3e78c835cc
commit
d0b29c1244
10 changed files with 211 additions and 101 deletions
|
|
@ -1,4 +1,9 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
services.ntfy-sh = {
|
||||
|
|
@ -19,13 +24,15 @@
|
|||
# Patch the generated config at runtime to inject the admin bcrypt hash
|
||||
systemd.services.ntfy-sh = {
|
||||
serviceConfig.RuntimeDirectory = "ntfy-sh";
|
||||
serviceConfig.ExecStartPre = let
|
||||
script = pkgs.writeShellScript "ntfy-patch-config" ''
|
||||
cp /etc/ntfy/server.yml /run/ntfy-sh/server.yml
|
||||
HASH=$(cat ${config.age.secrets.ntfy-admin-hash.path})
|
||||
printf '\nauth-users:\n - "jet:%s:admin"\n' "$HASH" >> /run/ntfy-sh/server.yml
|
||||
'';
|
||||
in [ "+${script}" ];
|
||||
serviceConfig.ExecStartPre =
|
||||
let
|
||||
script = pkgs.writeShellScript "ntfy-patch-config" ''
|
||||
cp /etc/ntfy/server.yml /run/ntfy-sh/server.yml
|
||||
HASH=$(cat ${config.age.secrets.ntfy-admin-hash.path})
|
||||
printf '\nauth-users:\n - "jet:%s:admin"\n' "$HASH" >> /run/ntfy-sh/server.yml
|
||||
'';
|
||||
in
|
||||
[ "+${script}" ];
|
||||
serviceConfig.ExecStart = lib.mkForce "${pkgs.ntfy-sh}/bin/ntfy serve --config /run/ntfy-sh/server.yml";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue