move from real users to passwd file

This commit is contained in:
Robin Raymond 2017-12-22 16:08:42 +01:00
parent 4fc8a1ed05
commit 2d0648e0f4
4 changed files with 16 additions and 14 deletions

View file

@ -14,10 +14,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
{ config }:
{ config, lib }:
let
cfg = config.mailserver;
# passwd :: [ String ]
passwd = lib.mapAttrsToList
(name: value: "${name}:${value.hashedPassword}:${builtins.toString cfg.vmailUID}:${builtins.toString cfg.vmailUID}::${cfg.mailDirectory}:/run/current-system/sw/bin/nologin:")
cfg.loginAccounts;
in
{
# cert :: PATH
@ -37,4 +41,6 @@ in
else if cfg.certificateScheme == 3
then "/var/lib/acme/${cfg.fqdn}/key.pem"
else throw "Error: Certificate Scheme must be in { 1, 2, 3 }";
# passwdFile :: PATH
passwdFile = builtins.toFile "passwd" (lib.concatStringsSep "\n" passwd);
}