Skip to content

lib.modules

A module declaring a garden service and its defaults, for a service module’s imports. The defaults are mkOptionDefault, so anything a host sets wins, and they hold while the service is disabled.

  • [name]: The name of the service
  • [defaults]: Its defaults, e.g. { port = 3033; }
mkService :: String -> AttrSet -> Module

Create a sops.secrets entry for a file in secrets/services/.

  • [file] the name of the sops file, without secrets/services/ or .yaml
  • every other attribute (key, owner, mode, …) is passed through to sops.secrets.<name> unchanged
mkSecret :: { file :: String, ... } -> AttrSet
mkSecret { file = "borg"; key = "forgejo-passphrase"; }
=> {
sopsFile = "${self}/secrets/services/borg.yaml";
key = "forgejo-passphrase";
}

The ports a web jail bans on. quic is on, so a tcp-only ban leaves http/3 open

web :: AttrSet

A fail2ban jail that reads a systemd unit’s journal and bans on its web ports

  • [unit]: The systemd unit, without .service
  • [regexes]: The failregexes, matched against each journal line
  • [settings]: Extra jail settings, these override the defaults
journalJail :: String -> [String] -> AttrSet -> AttrSet