X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Fprivate%2Fftp.nix;h=8ae4e650bb41facba3047842f05c8a68382ffc32;hp=a1da32f5925808125f4d1d64d40442c407a36748;hb=3c50eea8d946bf8417f49fa8a4a6e109e0439c7b;hpb=8415083eb6acc343dfa404dbbc12fa0171a48a20 diff --git a/modules/private/ftp.nix b/modules/private/ftp.nix index a1da32f..8ae4e65 100644 --- a/modules/private/ftp.nix +++ b/modules/private/ftp.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, myconfig, ... }: +{ lib, pkgs, config, ... }: let package = pkgs.pure-ftpd.override { ldapFtpId = "immaeFtp"; }; in @@ -14,7 +14,7 @@ in }; config = lib.mkIf config.services.pure-ftpd.enable { - services.backup.profiles.ftp = { + services.duplyBackup.profiles.ftp = { rootDir = "/var/lib/ftp"; }; security.acme.certs."ftp" = config.myServices.certificates.certConfig // { @@ -32,16 +32,13 @@ in }; }; - users.users = [ - { - name = "ftp"; - uid = config.ids.uids.ftp; # 8 - group = "ftp"; - description = "Anonymous FTP user"; - home = "/homeless-shelter"; - extraGroups = [ "keys" ]; - } - ]; + users.users.ftp = { + uid = config.ids.uids.ftp; # 8 + group = "ftp"; + description = "Anonymous FTP user"; + home = "/homeless-shelter"; + extraGroups = [ "keys" ]; + }; users.groups.ftp.gid = config.ids.gids.ftp; @@ -55,17 +52,17 @@ in user = "ftp"; group = "ftp"; text = '' - LDAPServer ${myconfig.env.ftp.ldap.host} + LDAPServer ${config.myEnv.ftp.ldap.host} LDAPPort 389 LDAPUseTLS True - LDAPBaseDN ${myconfig.env.ftp.ldap.base} - LDAPBindDN ${myconfig.env.ftp.ldap.dn} - LDAPBindPW ${myconfig.env.ftp.ldap.password} + LDAPBaseDN ${config.myEnv.ftp.ldap.base} + LDAPBindDN ${config.myEnv.ftp.ldap.dn} + LDAPBindPW ${config.myEnv.ftp.ldap.password} LDAPDefaultUID 500 LDAPForceDefaultUID False LDAPDefaultGID 100 LDAPForceDefaultGID False - LDAPFilter ${myconfig.env.ftp.ldap.filter} + LDAPFilter ${config.myEnv.ftp.ldap.filter} LDAPAuthMethod BIND @@ -113,7 +110,7 @@ in MaxDiskUsage 99 CustomerProof yes TLS 1 - CertFile ${config.security.acme.directory}/ftp/full.pem + CertFile ${config.security.acme.certs.ftp.directory}/full.pem ''; in { description = "Pure-FTPd server";