Added Webmail service

This commit is contained in:
Illia Chub 2021-04-09 16:46:32 +03:00
parent 5d2b8a6924
commit 16434502d0

View file

@ -42,6 +42,7 @@ makeConf() {
$NIXOS_IMPORT
./files.nix
./mailserver/system/mailserver.nix
./mailserver/system/alps.nix
./vpn/ocserv.nix
./api/api.nix
./api/api-module.nix
@ -1053,6 +1054,57 @@ config :pleroma, :http_security,
config :pleroma, configurable_from_database: false
EOF
cat > /etc/nixos/mailserver/system/alps.nix << EOF
{ pkgs, lib, fetchgit, buildGoModule, ... }: {
nixpkgs.overlays =
[ (self: super: { alps = self.callPackage ./alps-package.nix { }; }) ];
systemd.services = {
alps = {
path = [ pkgs.alps pkgs.coreutils ];
serviceConfig = {
ExecStart =
"\${pkgs.alps}/bin/alps -theme sourcehut imaps://$DOMAIN:993 smtps://$DOMAIN:465";
WorkingDirectory = "\${pkgs.alps}/bin";
};
};
};
}
EOF
cat > /etc/nixos/mailserver/system/alps-package.nix << EOF
{ lib, fetchgit, buildGoModule, ... }:
buildGoModule rec {
pname = "alps";
version = "v1.0.0"; # latest available tag at the moment
src = fetchGit {
url = "https://git.selfprivacy.org/ilchub/selfprivacy-alps";
rev = "dc2109ca2fdabfbda5d924faa4947f5694d5d758";
};
vendorSha256 = "0bqg0qjam4mvh07wfil6l5spz32mk5a7kfxxnwfyva805pzmn6dk";
deleteVendor = false;
runVend = true;
buildPhase = ''
go build ./cmd/alps
'';
installPhase = ''
mkdir -p $out/bin
cp -r * $out/bin
'';
meta = with lib; {
description = "Webmail application for the dovecot/postfix mailserver";
homepage = "https://git.selfprivacy.org/ilchub/selfprivacy-alps";
license = licenses.mit;
};
}
EOF
[[ -n "$doNetConf" ]] && makeNetworkingConf || true