Format the entire project.

This commit is contained in:
Kevin Baensch 2023-09-11 20:23:04 +02:00
parent 1dc50ae17d
commit 6f9db5e3a4
Signed by: derped
GPG key ID: C0F1D326C7626543
115 changed files with 3451 additions and 2901 deletions

View file

@ -1,21 +1,26 @@
{ config, pkgs, lib, ... }:
with lib;
let
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.system.copySysConf;
cfgPath = ../.;
copySysConf = if !(isStorePath cfgPath) then pkgs.stdenv.mkDerivation rec {
name = "NixOS_Configuration-${version}";
version = commitIdFromGitRepo (cfgPath + "/.git");
copySysConf =
if !(isStorePath cfgPath)
then
pkgs.stdenv.mkDerivation rec {
name = "NixOS_Configuration-${version}";
version = commitIdFromGitRepo (cfgPath + "/.git");
src = cleanSource cfgPath;
installPhase = ''
cp -R ./. $out
'';
} else (builtins.toPath ../.);
src = cleanSource cfgPath;
installPhase = ''
cp -R ./. $out
'';
}
else (builtins.toPath ../.);
in {
options.system.copySysConf = {
enable = mkOption {

View file

@ -1,20 +1,15 @@
# Original Source:
# https://gitlab.com/rycee/nur-expressions/raw/master/hm-modules/emacs-init-defaults.nix (49ff2d63e867c09e658c959c0d8a73d641061c30)
# MIT License
# Copyright (c) 2019 Robert Helgesson
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -22,11 +17,7 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
{ pkgs, ... }:
{
{pkgs, ...}: {
programs.emacs.init.usePackage = {
deadgrep = {
config = ''

View file

@ -1,20 +1,15 @@
# Original Source:
# https://gitlab.com/rycee/nur-expressions/raw/master/hm-modules/emacs-init.nix (d27525db3358b9463fab1b4a7739cb77e27b768c)
# MIT License
# Copyright (c) 2019 Robert Helgesson
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -22,14 +17,13 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
{ config, lib, pkgs, ... }:
with lib;
let
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.programs.emacs.init;
packageFunctionType = mkOptionType {
@ -39,15 +33,19 @@ let
merge = mergeOneOption;
};
usePackageType = types.submodule ({ name, config, ... }: {
usePackageType = types.submodule ({
name,
config,
...
}: {
options = {
enable = mkEnableOption "Emacs package ${name}";
package = mkOption {
type =
types.either
(types.str // { description = "name of package"; })
packageFunctionType;
(types.str // {description = "name of package";})
packageFunctionType;
default = name;
description = ''
The package to use for this module. Either the package name
@ -83,7 +81,10 @@ let
chords = mkOption {
type = types.attrsOf types.str;
default = {};
example = { "jj" = "ace-jump-char-mode"; "jk" = "ace-jump-word-mode"; };
example = {
"jj" = "ace-jump-char-mode";
"jk" = "ace-jump-word-mode";
};
description = ''
The entries to use for <option>:chords</option>.
'';
@ -108,7 +109,10 @@ let
bind = mkOption {
type = types.attrsOf types.str;
default = {};
example = { "M-<up>" = "drag-stuff-up"; "M-<down>" = "drag-stuff-down"; };
example = {
"M-<up>" = "drag-stuff-up";
"M-<down>" = "drag-stuff-down";
};
description = ''
The entries to use for <option>:bind</option>.
'';
@ -117,7 +121,7 @@ let
bindLocal = mkOption {
type = types.attrsOf (types.attrsOf types.str);
default = {};
example = { helm-command-map = { "C-c h" = "helm-execute-persistent-action"; }; };
example = {helm-command-map = {"C-c h" = "helm-execute-persistent-action";};};
description = ''
The entries to use for local keymaps in <option>:bind</option>.
'';
@ -126,7 +130,7 @@ let
bindKeyMap = mkOption {
type = types.attrsOf types.str;
default = {};
example = { "C-c p" = "projectile-command-map"; };
example = {"C-c p" = "projectile-command-map";};
description = ''
The entries to use for <option>:bind-keymap</option>.
'';
@ -181,51 +185,51 @@ let
};
config = mkIf config.enable {
assembly =
let
quoted = v: ''"${escape ["\""] v}"'';
mkBindHelper = cmd: prefix: bs:
optionals (bs != {}) (
[ ":${cmd} (${prefix}" ]
++ mapAttrsToList (n: v: " (${quoted n} . ${v})") bs
++ [ ")" ]
assembly = let
quoted = v: ''"${escape ["\""] v}"'';
mkBindHelper = cmd: prefix: bs:
optionals (bs != {}) (
[":${cmd} (${prefix}"]
++ mapAttrsToList (n: v: " (${quoted n} . ${v})") bs
++ [")"]
);
mkAfter = vs: optional (vs != []) ":after (${toString vs})";
mkCommand = vs: optional (vs != []) ":commands (${toString vs})";
mkDiminish = vs: optional (vs != []) ":diminish (${toString vs})";
mkMode = map (v: ":mode ${v}");
mkBind = mkBindHelper "bind" "";
mkBindLocal = bs:
let
mkMap = n: v: mkBindHelper "bind" ":map ${n}" v;
in
flatten (mapAttrsToList mkMap bs);
mkBindKeyMap = mkBindHelper "bind-keymap" "";
mkChords = mkBindHelper "chords" "";
mkHook = map (v: ":hook ${v}");
mkDefer = v:
if isBool v then optional v ":defer t"
else [ ":defer ${toString v}" ];
mkDemand = v: optional v ":demand t";
mkAfter = vs: optional (vs != []) ":after (${toString vs})";
mkCommand = vs: optional (vs != []) ":commands (${toString vs})";
mkDiminish = vs: optional (vs != []) ":diminish (${toString vs})";
mkMode = map (v: ":mode ${v}");
mkBind = mkBindHelper "bind" "";
mkBindLocal = bs: let
mkMap = n: v: mkBindHelper "bind" ":map ${n}" v;
in
concatStringsSep "\n " (
[ "(use-package ${name}" ]
++ mkAfter config.after
++ mkBind config.bind
++ mkBindKeyMap config.bindKeyMap
++ mkBindLocal config.bindLocal
++ mkChords config.chords
++ mkCommand config.command
++ mkDefer config.defer
++ mkDemand config.demand
++ mkDiminish config.diminish
++ mkHook config.hook
++ mkMode config.mode
++ optionals (config.init != "") [ ":init" config.init ]
++ optionals (config.config != "") [ ":config" config.config ]
++ optional (config.extraConfig != "") config.extraConfig
) + ")";
flatten (mapAttrsToList mkMap bs);
mkBindKeyMap = mkBindHelper "bind-keymap" "";
mkChords = mkBindHelper "chords" "";
mkHook = map (v: ":hook ${v}");
mkDefer = v:
if isBool v
then optional v ":defer t"
else [":defer ${toString v}"];
mkDemand = v: optional v ":demand t";
in
concatStringsSep "\n " (
["(use-package ${name}"]
++ mkAfter config.after
++ mkBind config.bind
++ mkBindKeyMap config.bindKeyMap
++ mkBindLocal config.bindLocal
++ mkChords config.chords
++ mkCommand config.command
++ mkDefer config.defer
++ mkDemand config.demand
++ mkDiminish config.diminish
++ mkHook config.hook
++ mkMode config.mode
++ optionals (config.init != "") [":init" config.init]
++ optionals (config.config != "") [":config" config.config]
++ optional (config.extraConfig != "") config.extraConfig
)
+ ")";
};
});
@ -234,17 +238,20 @@ let
${pkgConfStr})
'';
mkRecommendedOption = type: extraDescription: mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether to enable recommended ${type} settings.
'' + optionalString (extraDescription != "") ''
</para><para>
${extraDescription}
'';
};
mkRecommendedOption = type: extraDescription:
mkOption {
type = types.bool;
default = false;
example = true;
description =
''
Whether to enable recommended ${type} settings.
''
+ optionalString (extraDescription != "") ''
</para><para>
${extraDescription}
'';
};
# Recommended GC settings.
gcSettings = ''
@ -285,7 +292,7 @@ let
hasBind = any (p: p.bind != {}) (attrValues cfg.usePackage);
# Whether the configuration makes use of `:chords`.
hasChords = any ( p: p.chords != {}) (attrValues cfg.usePackage);
hasChords = any (p: p.chords != {}) (attrValues cfg.usePackage);
usePackageSetup =
''
@ -300,8 +307,10 @@ let
;; To help fixing issues during startup.
(setq use-package-verbose ${
if cfg.usePackageVerbose then "t" else "nil"
}))
if cfg.usePackageVerbose
then "t"
else "nil"
}))
''
+ optionalString hasDiminish ''
;; For :diminish in (use-package).
@ -317,53 +326,51 @@ let
:config (key-chord-mode 1))
'';
initFile = ''
;;; hm-init.el --- Emacs configuration à la Home Manager.
;;
;; -*- lexical-binding: t; -*-
;;
;;; Commentary:
;;
;; A configuration generated from a Nix based configuration by
;; Home Manager.
;;
;;; Code:
initFile =
''
;;; hm-init.el --- Emacs configuration à la Home Manager.
;;
;; -*- lexical-binding: t; -*-
;;
;;; Commentary:
;;
;; A configuration generated from a Nix based configuration by
;; Home Manager.
;;
;;; Code:
${optionalString cfg.startupTimer ''
;; Remember when configuration started. See bottom for rest of this.
;; Idea taken from http://writequit.org/org/settings.html.
(defconst emacs-start-time (current-time))
''}
${optionalString cfg.startupTimer ''
;; Remember when configuration started. See bottom for rest of this.
;; Idea taken from http://writequit.org/org/settings.html.
(defconst emacs-start-time (current-time))
''}
${optionalString cfg.recommendedGcSettings gcSettings}
${optionalString cfg.recommendedGcSettings gcSettings}
${cfg.prelude}
${cfg.prelude}
${usePackageSetup}
''
+ concatStringsSep "\n\n"
${usePackageSetup}
''
+ concatStringsSep "\n\n"
(map (getAttr "assembly")
(filter (getAttr "enable")
(attrValues cfg.usePackage)))
+ ''
(filter (getAttr "enable")
(attrValues cfg.usePackage)))
+ ''
${cfg.postlude}
${cfg.postlude}
${optionalString cfg.startupTimer ''
;; Make a note of how long the configuration part of the start took.
(let ((elapsed (float-time (time-subtract (current-time)
emacs-start-time))))
(message "Loading settings...done (%.3fs)" elapsed))
''}
${optionalString cfg.startupTimer ''
;; Make a note of how long the configuration part of the start took.
(let ((elapsed (float-time (time-subtract (current-time)
emacs-start-time))))
(message "Loading settings...done (%.3fs)" elapsed))
''}
(provide 'hm-init)
;; hm-init.el ends here
'';
in
{
imports = [ ./emacs-init-defaults.nix ];
(provide 'hm-init)
;; hm-init.el ends here
'';
in {
imports = [./emacs-init-defaults.nix];
options.programs.emacs.init = {
enable = mkEnableOption "Emacs configuration";
@ -412,29 +419,31 @@ in
};
config = mkIf cfg.enable {
machine.pkgsets.emacs.pkgs = epkgs:
let
getPkg = v:
if isFunction v then [ (v epkgs) ]
else optional (isString v && hasAttr v epkgs) epkgs.${v};
in
[ epkgs.use-package ]
++ optional hasBind epkgs.bind-key
++ optional hasDiminish epkgs.diminish
++ optional hasChords epkgs.use-package-chords
++ (
concatMap (v: getPkg (v.package))
(builtins.attrValues cfg.usePackage)
);
machine.pkgsets.emacs.pkgs = epkgs: let
getPkg = v:
if isFunction v
then [(v epkgs)]
else optional (isString v && hasAttr v epkgs) epkgs.${v};
in
[epkgs.use-package]
++ optional hasBind epkgs.bind-key
++ optional hasDiminish epkgs.diminish
++ optional hasChords epkgs.use-package-chords
++ (
concatMap (v: getPkg (v.package))
(builtins.attrValues cfg.usePackage)
);
# use lucid as toolkit; emacs will otherwise crash quite frequently when run in daemon mode
# https://gitlab.gnome.org/GNOME/gtk/issues/221
machine.pkgsets.emacs.pkgwrap = let
emacsWithPackages = (pkgs.emacsPackagesFor
(pkgs.emacs.override {
withGTK2 = false;
withGTK3 = false;
})).emacsWithPackages;
emacsWithPackages =
(pkgs.emacsPackagesFor
(pkgs.emacs.override {
withGTK2 = false;
withGTK3 = false;
}))
.emacsWithPackages;
in (emacsWithPackages config.machine.pkgsets.emacs.pkgs);
environment.systemPackages = [

View file

@ -1,9 +1,11 @@
{ config, lib, fn, ... }:
{
config,
lib,
fn,
...
}:
with builtins;
with lib;
let
with lib; let
cfg = config.machine;
pkgsetList = fn.makeOptionTypeList (toString ../pkgsets);
serviceList = fn.makeOptionTypeList (toString ../services);
@ -11,8 +13,8 @@ let
name = pname;
value = rec {
pkgwrap = mkOption {
type = with types; oneOf [ package (listOf package) ];
default = (fn.pkgFilter cfg.pkgsets."${pname}".pkgs);
type = with types; oneOf [package (listOf package)];
default = fn.pkgFilter cfg.pkgsets."${pname}".pkgs;
description = ''
Package Wrapper for packages using a wrapper function (like python, emacs, haskell, ...)
'';
@ -29,8 +31,8 @@ let
in {
options.machine = {
pkgs = mkOption {
type = (types.listOf (types.enum pkgsetList));
default = [ "base" ];
type = types.listOf (types.enum pkgsetList);
default = ["base"];
description = ''
The list of metapackages to be installed.
'';
@ -38,7 +40,7 @@ in {
# Package names containing '::' are sub packages and should not have their own pkgset.
pkgsets = listToAttrs (map pkgOption (lists.filter (v: !(strings.hasInfix "::" v)) pkgsetList));
services = mkOption {
type = (types.listOf (types.enum serviceList));
type = types.listOf (types.enum serviceList);
default = [];
description = ''
List of services to be enabled.
@ -46,7 +48,7 @@ in {
};
conffiles = mkOption {
type = types.listOf types.str;
default = [ "zsh" ];
default = ["zsh"];
description = ''
List of configuration files to be enabled.
'';
@ -116,7 +118,7 @@ in {
};
};
imports = [
(mkAliasOptionModule [ "machine" "firewall" ] [ "networking" "firewall" ])
(mkAliasOptionModule [ "machine" "allowUnfree" ] [ "nixpkgs" "config" "allowUnfree" ])
(mkAliasOptionModule ["machine" "firewall"] ["networking" "firewall"])
(mkAliasOptionModule ["machine" "allowUnfree"] ["nixpkgs" "config" "allowUnfree"])
];
}

View file

@ -1,10 +1,29 @@
{ stdenv, buildPythonPackage, fetchgit
, aiosmtpd, alembic, atpublic, click, dnspython, falcon, flufl_bounce, flufl_i18n, flufl_lock
, importlib-resources, lazr_config, passlib, requests, sqlalchemy
, zope_component, zope_configuration, zope_event, zope_interface
# optional database dependencies
, pymysql, psycopg2 }:
{
stdenv,
buildPythonPackage,
fetchgit,
aiosmtpd,
alembic,
atpublic,
click,
dnspython,
falcon,
flufl_bounce,
flufl_i18n,
flufl_lock,
importlib-resources,
lazr_config,
passlib,
requests,
sqlalchemy,
zope_component,
zope_configuration,
zope_event,
zope_interface,
# optional database dependencies
pymysql,
psycopg2,
}:
buildPythonPackage rec {
name = "mailman3_core-${version}";
version = "3.2.2";
@ -33,7 +52,8 @@ buildPythonPackage rec {
zope_configuration
zope_event
zope_interface
pymysql psycopg2
pymysql
psycopg2
];
doCheck = false;
@ -48,7 +68,7 @@ buildPythonPackage rec {
meta = with stdenv.lib; {
description = "GNU Mailman, a mailing list management system";
license = licenses.gpl3;
maintainers = with maintainers; [ ];
maintainers = with maintainers; [];
homepage = http://list.org/;
};
}

View file

@ -1,14 +1,18 @@
{ stdenv, lib, fetchPypi, buildPythonPackage
, atpublic }:
{
stdenv,
lib,
fetchPypi,
buildPythonPackage,
atpublic,
}:
buildPythonPackage rec {
pname = "aiosmtpd";
version = "1.2";
pname = "aiosmtpd";
version = "1.2";
src = fetchPypi {
inherit pname version;
sha256 = "1xdfk741pjmz1cm8dsi4n5vq4517i175rm94696m3f7kcgk7xsmp";
};
doCheck = false;
propagatedBuildInputs = [ atpublic ];
src = fetchPypi {
inherit pname version;
sha256 = "1xdfk741pjmz1cm8dsi4n5vq4517i175rm94696m3f7kcgk7xsmp";
};
doCheck = false;
propagatedBuildInputs = [atpublic];
}

View file

@ -1,13 +1,17 @@
{ stdenv, lib, fetchPypi, buildPythonPackage }:
{
stdenv,
lib,
fetchPypi,
buildPythonPackage,
}:
buildPythonPackage rec {
pname = "atpublic";
version = "1.0";
pname = "atpublic";
version = "1.0";
src = fetchPypi {
inherit pname version;
sha256 = "0i3sbxkdlbb4560rrlmwwd5y4ps7k73lp4d8wnmd7ag9k426gjkx";
};
doCheck = false;
# propagatedBuildInputs = [];
src = fetchPypi {
inherit pname version;
sha256 = "0i3sbxkdlbb4560rrlmwwd5y4ps7k73lp4d8wnmd7ag9k426gjkx";
};
doCheck = false;
# propagatedBuildInputs = [];
}

View file

@ -1,6 +1,11 @@
{ stdenv, lib, fetchPypi, buildPythonPackage
, atpublic, zope_interface }:
{
stdenv,
lib,
fetchPypi,
buildPythonPackage,
atpublic,
zope_interface,
}:
buildPythonPackage rec {
name = "${pname}-${version}";
pname = "flufl.bounce";
@ -11,7 +16,7 @@ buildPythonPackage rec {
sha256 = "0k5kjqa3x6gvwwxyzb2vwi1g1i6asm1zw5fivylxz3d583y4kid2";
};
propagatedBuildInputs = [ atpublic zope_interface ];
propagatedBuildInputs = [atpublic zope_interface];
doCheck = false;
}

View file

@ -1,6 +1,10 @@
{ stdenv, lib, fetchPypi, buildPythonPackage
, atpublic }:
{
stdenv,
lib,
fetchPypi,
buildPythonPackage,
atpublic,
}:
buildPythonPackage rec {
name = "${pname}-${version}";
pname = "flufl.i18n";
@ -11,7 +15,7 @@ buildPythonPackage rec {
sha256 = "1csgds59nx0ann9v2alqr69lakp1cnc1ikmbgn96l6n23js7c2ah";
};
propagatedBuildInputs = [ atpublic ];
propagatedBuildInputs = [atpublic];
doCheck = false;
}

View file

@ -1,6 +1,10 @@
{ stdenv, lib, fetchPypi, buildPythonPackage
, atpublic }:
{
stdenv,
lib,
fetchPypi,
buildPythonPackage,
atpublic,
}:
buildPythonPackage rec {
name = "${pname}-${version}";
pname = "flufl.lock";
@ -11,7 +15,7 @@ buildPythonPackage rec {
sha256 = "0nzzd6l30ff6cwsrlrb94xzfja4wkyrqv3ydc6cz0hdbr766mmm8";
};
propagatedBuildInputs = [ atpublic ];
propagatedBuildInputs = [atpublic];
doCheck = false;
}

View file

@ -1,6 +1,10 @@
{ stdenv, lib, fetchPypi, buildPythonPackage
, lazr_delegates }:
{
stdenv,
lib,
fetchPypi,
buildPythonPackage,
lazr_delegates,
}:
buildPythonPackage rec {
name = "${pname}-${version}";
pname = "lazr.config";
@ -11,7 +15,7 @@ buildPythonPackage rec {
sha256 = "1s7pyvlq06qjrkaw9r6nc290lb095n25ybzgavvy51ygpxkgqxwn";
};
propagatedBuildInputs = [ lazr_delegates ];
propagatedBuildInputs = [lazr_delegates];
doCheck = false;
}

View file

@ -1,6 +1,11 @@
{ stdenv, lib, fetchPypi, buildPythonPackage
, nose, zope_interface }:
{
stdenv,
lib,
fetchPypi,
buildPythonPackage,
nose,
zope_interface,
}:
buildPythonPackage rec {
name = "${pname}-${version}";
pname = "lazr.delegates";
@ -11,7 +16,7 @@ buildPythonPackage rec {
sha256 = "1rdnl85j9ayp8n85l0ciip621j9dcziz5qnmv2m7krgwgcn31vfx";
};
propagatedBuildInputs = [ nose zope_interface ];
propagatedBuildInputs = [nose zope_interface];
doCheck = false;
}

View file

@ -1,9 +1,11 @@
{ pkgs, lib, config, ... }:
with lib;
let
mailman3 = import ./release.nix { };
{
pkgs,
lib,
config,
...
}:
with lib; let
mailman3 = import ./release.nix {};
cfg = config.services.mailman3;
usePostgresql = cfg.database.type == "postgresql";
useSqlite = cfg.database.type == "sqlite3";
@ -102,7 +104,7 @@ in {
database = {
type = mkOption {
type = types.enum [ "sqlite3" "mysql" "postgres" ];
type = types.enum ["sqlite3" "mysql" "postgres"];
default = "sqlite3";
example = "mysql";
description = ''
@ -271,7 +273,7 @@ in {
mta = {
# TODO: add Sentmail and qmail
type = mkOption {
type = types.enum [ "postfix" "exim4" ];
type = types.enum ["postfix" "exim4"];
default = "postfix";
example = "exim4";
description = ''
@ -357,7 +359,6 @@ in {
};
};
config = mkIf cfg.enable {
users = mkIf (cfg.user == "mailman3") {
users.mailman3 = {
@ -365,7 +366,7 @@ in {
home = cfg.paths.var_dir;
createHome = true;
useDefaultShell = true;
packages = [ mailman3.core ];
packages = [mailman3.core];
};
};
@ -374,25 +375,25 @@ in {
services.postfix.mapFiles."local_recipient_maps" = mkIf usePostfix (mkDefault "${cfg.paths.data_dir}/postfix_lmtp");
services.postfix.mapFiles."relay_domains" = mkIf usePostfix (mkDefault "${cfg.paths.data_dir}/postfix_domains");
warnings = optional (cfg.database.password != "")
''config.services.mailman3.database.password will be stored as plaintext
in the Nix store. Use database.passwordFile instead.'';
warnings =
optional (cfg.database.password != "")
'' config.services.mailman3.database.password will be stored as plaintext
in the Nix store. Use database.passwordFile instead.'';
# Create database passwordFile default when password is configured.
services.mailman3.database.passwordFile =
(mkDefault (toString (pkgs.writeTextFile {
name = "mailman3-database-password";
text = cfg.database.password;
})));
services.mailman3.database.passwordFile = mkDefault (toString (pkgs.writeTextFile {
name = "mailman3-database-password";
text = cfg.database.password;
}));
systemd.services.mailman3 = {
description = "GNU Mailing List Manager";
after = [ "network.target" ] ++ lib.optional usePostgresql "postgresql.service" ++ lib.optional useMysql "mysql.service";
wantedBy = [ "multi-user.target" ];
after = ["network.target"] ++ lib.optional usePostgresql "postgresql.service" ++ lib.optional useMysql "mysql.service";
wantedBy = ["multi-user.target"];
preStart = let
dbpass = (fileContents cfg.database.passwordFile);
smtppass = (fileContents cfg.mta.smtp_passFile);
dbpass = fileContents cfg.database.passwordFile;
smtppass = fileContents cfg.mta.smtp_passFile;
in ''
mkdir -p ${cfg.paths.etc_dir}
cp ${configFile} ${cfg.paths.etc_dir}/mailman.cfg

View file

@ -1,8 +1,9 @@
{ pkgs ? import <nixpkgs> {}, python3Packages ? pkgs.python3Packages }:
let
{
pkgs ? import <nixpkgs> {},
python3Packages ? pkgs.python3Packages,
}: let
mailman3 = {
core = python3Packages.callPackage ./core.nix ( with deps; {
core = python3Packages.callPackage ./core.nix (with deps; {
inherit aiosmtpd atpublic flufl_bounce flufl_i18n flufl_lock lazr_config;
});
};
@ -10,7 +11,7 @@ let
aiosmtpd = python3Packages.callPackage ./extraPackages/aiosmtpd.nix {
inherit atpublic;
};
atpublic = python3Packages.callPackage ./extraPackages/atpublic.nix { };
atpublic = python3Packages.callPackage ./extraPackages/atpublic.nix {};
flufl_bounce = python3Packages.callPackage ./extraPackages/flufl_bounce.nix {
inherit atpublic;
};
@ -23,6 +24,7 @@ let
lazr_config = python3Packages.callPackage ./extraPackages/lazr_config.nix {
inherit lazr_delegates;
};
lazr_delegates = python3Packages.callPackage ./extraPackages/lazr_delegates.nix { };
lazr_delegates = python3Packages.callPackage ./extraPackages/lazr_delegates.nix {};
};
in mailman3
in
mailman3