{ config, pkgs, lib, flakeInputs, ... }: with lib; let dovecotSievePipeBin = pkgs.stdenv.mkDerivation { name = "dovecot-sieve-pipe-bin"; src = ./dovecot-pipe-bin; buildInputs = with pkgs; [ makeWrapper coreutils bash rspamd ]; buildCommand = '' mkdir -p $out/pipe/bin cp $src/* $out/pipe/bin/ chmod a+x $out/pipe/bin/* patchShebangs $out/pipe/bin for file in $out/pipe/bin/*; do wrapProgram $file \ --set PATH "${pkgs.coreutils}/bin:${pkgs.rspamd}/bin" done ''; }; ccert-policy-server = with pkgs.poetry2nix; mkPoetryApplication { projectDir = cleanPythonSources { src = ./ccert-policy-server; }; overrides = overrides.withDefaults (self: super: { systemd-python = super.systemd-python.overridePythonAttrs (oldAttrs: { buildInputs = (oldAttrs.buildInputs or []) ++ [ super.setuptools ]; }); }); }; nftables-nologin-script = pkgs.writeScript "nftables-mail-nologin" '' #!${pkgs.zsh}/bin/zsh set -e export PATH="${lib.makeBinPath (with pkgs; [inetutils nftables])}:$PATH" typeset -a as_sets route route6 as_sets=(${lib.escapeShellArgs config.services.email.nologinASSets}) for as_set in $as_sets; do while IFS=$'\n' read line; do if [[ "''${line}" =~ "^route:\s+(.+)$" ]]; then route+=($match[1]) elif [[ "''${line}" =~ "^route6:\s+(.+)$" ]]; then route6+=($match[1]) fi done < <(whois -h whois.radb.net "!i''${as_set},1" | egrep -o 'AS[0-9]+' | xargs -- whois -h whois.radb.net -- -i origin) done printf -v elements4 '%s,' "''${route[@]}" elements4=''${elements4%,} printf -v elements6 '%s,' "''${route6[@]}" elements6=''${elements6%,} nft -f - <