From d2e703c560bc029c3d607058de2935bbf1cb0559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 24 Oct 2019 00:35:49 +0200 Subject: Rename backup module to duply_backup --- modules/backup/default.nix | 104 --------------------- modules/default.nix | 2 +- modules/duply_backup/default.nix | 104 +++++++++++++++++++++ modules/private/buildbot/default.nix | 2 +- modules/private/certificates.nix | 2 +- modules/private/ftp.nix | 2 +- modules/private/gitolite/default.nix | 2 +- modules/private/irc.nix | 2 +- modules/private/mail/default.nix | 2 +- modules/private/mail/dovecot.nix | 2 +- modules/private/mail/postfix.nix | 2 +- modules/private/mail/rspamd.nix | 2 +- modules/private/monitoring/default.nix | 2 +- modules/private/mpd.nix | 2 +- modules/private/pub/default.nix | 2 +- modules/private/system.nix | 2 +- modules/private/system/eldiron.nix | 2 +- modules/private/tasks/default.nix | 2 +- modules/private/websites/aten/integration.nix | 2 +- modules/private/websites/aten/production.nix | 2 +- modules/private/websites/chloe/integration.nix | 2 +- modules/private/websites/chloe/production.nix | 2 +- .../websites/connexionswing/integration.nix | 2 +- .../private/websites/connexionswing/production.nix | 2 +- modules/private/websites/default.nix | 2 +- modules/private/websites/emilia/production.nix | 2 +- modules/private/websites/florian/app.nix | 2 +- .../websites/ludivinecassal/integration.nix | 2 +- .../private/websites/ludivinecassal/production.nix | 2 +- .../private/websites/piedsjaloux/integration.nix | 2 +- .../private/websites/piedsjaloux/production.nix | 2 +- .../private/websites/tools/diaspora/default.nix | 2 +- modules/private/websites/tools/ether/default.nix | 2 +- modules/private/websites/tools/mail/default.nix | 2 +- .../private/websites/tools/mastodon/default.nix | 2 +- modules/private/websites/tools/tools/default.nix | 2 +- modules/webapps/webstats/default.nix | 2 +- 37 files changed, 139 insertions(+), 139 deletions(-) delete mode 100644 modules/backup/default.nix create mode 100644 modules/duply_backup/default.nix (limited to 'modules') diff --git a/modules/backup/default.nix b/modules/backup/default.nix deleted file mode 100644 index be12231..0000000 --- a/modules/backup/default.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ lib, pkgs, myconfig, config, ... }: - -let - cfg = myconfig.env.backup; - varDir = "/var/lib/duply"; - duplyProfile = profile: prefix: '' - GPG_PW="${cfg.password}" - TARGET="${cfg.remote}${prefix}" - export AWS_ACCESS_KEY_ID="${cfg.accessKeyId}" - export AWS_SECRET_ACCESS_KEY="${cfg.secretAccessKey}" - SOURCE="${profile.rootDir}" - FILENAME=".duplicity-ignore" - DUPL_PARAMS="$DUPL_PARAMS --exclude-if-present '$FILENAME'" - VERBOSITY=4 - ARCH_DIR="${varDir}/caches" - - # Do a full backup after 1 month - MAX_FULLBKP_AGE=1M - DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE " - # Backups older than 2months are deleted - MAX_AGE=2M - # Keep 2 full backups - MAX_FULL_BACKUPS=2 - MAX_FULLS_WITH_INCRS=2 - ''; - action = "bkp_purge_purgeFull_purgeIncr"; -in -{ - options = { - services.backup.enable = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Whether to enable remote backups. - ''; - }; - services.backup.profiles = lib.mkOption { - type = lib.types.attrsOf (lib.types.submodule { - options = { - rootDir = lib.mkOption { - type = lib.types.path; - description = '' - Path to backup - ''; - }; - excludeFile = lib.mkOption { - type = lib.types.lines; - default = ""; - description = '' - Content to put in exclude file - ''; - }; - }; - }); - }; - }; - - config = lib.mkIf config.services.backup.enable { - system.activationScripts.backup = '' - install -m 0700 -o root -g root -d ${varDir} ${varDir}/caches - ''; - secrets.keys = lib.flatten (lib.mapAttrsToList (k: v: [ - { - permissions = "0400"; - dest = "backup/${k}/conf"; - text = duplyProfile v "${k}/"; - } - { - permissions = "0400"; - dest = "backup/${k}/exclude"; - text = v.excludeFile; - } - ]) config.services.backup.profiles); - - services.cron = { - enable = true; - systemCronJobs = let - backups = pkgs.writeScript "backups" '' - #!${pkgs.stdenv.shell} - - ${builtins.concatStringsSep "\n" (lib.mapAttrsToList (k: v: - '' - touch ${varDir}/${k}.log - ${pkgs.duply}/bin/duply ${config.secrets.location}/backup/${k}/ ${action} --force >> ${varDir}/${k}.log - '' - ) config.services.backup.profiles)} - ''; - in - [ - "0 2 * * * root ${backups}" - ]; - - }; - - security.pki.certificates = let - cert = pkgs.fetchurl { - url = "http://downloads.e.eriomem.net/eriomemca.pem"; - sha256 = "1ixx4c6j3m26j8dp9a3dkvxc80v1nr5aqgmawwgs06bskasqkvvh"; - }; - in [ - (builtins.readFile cert) - ]; - }; -} diff --git a/modules/default.nix b/modules/default.nix index 05f2bfe..18bee9a 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -13,7 +13,7 @@ opendmarc = ./opendmarc.nix; openarc = ./openarc.nix; - backup = ./backup; + duplyBackup = ./duply_backup; naemon = ./naemon; php-application = ./websites/php-application.nix; diff --git a/modules/duply_backup/default.nix b/modules/duply_backup/default.nix new file mode 100644 index 0000000..32fa941 --- /dev/null +++ b/modules/duply_backup/default.nix @@ -0,0 +1,104 @@ +{ lib, pkgs, myconfig, config, ... }: + +let + cfg = myconfig.env.backup; + varDir = "/var/lib/duply"; + duplyProfile = profile: prefix: '' + GPG_PW="${cfg.password}" + TARGET="${cfg.remote}${prefix}" + export AWS_ACCESS_KEY_ID="${cfg.accessKeyId}" + export AWS_SECRET_ACCESS_KEY="${cfg.secretAccessKey}" + SOURCE="${profile.rootDir}" + FILENAME=".duplicity-ignore" + DUPL_PARAMS="$DUPL_PARAMS --exclude-if-present '$FILENAME'" + VERBOSITY=4 + ARCH_DIR="${varDir}/caches" + + # Do a full backup after 1 month + MAX_FULLBKP_AGE=1M + DUPL_PARAMS="$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE " + # Backups older than 2months are deleted + MAX_AGE=2M + # Keep 2 full backups + MAX_FULL_BACKUPS=2 + MAX_FULLS_WITH_INCRS=2 + ''; + action = "bkp_purge_purgeFull_purgeIncr"; +in +{ + options = { + services.duplyBackup.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to enable remote backups. + ''; + }; + services.duplyBackup.profiles = lib.mkOption { + type = lib.types.attrsOf (lib.types.submodule { + options = { + rootDir = lib.mkOption { + type = lib.types.path; + description = '' + Path to backup + ''; + }; + excludeFile = lib.mkOption { + type = lib.types.lines; + default = ""; + description = '' + Content to put in exclude file + ''; + }; + }; + }); + }; + }; + + config = lib.mkIf config.services.duplyBackup.enable { + system.activationScripts.backup = '' + install -m 0700 -o root -g root -d ${varDir} ${varDir}/caches + ''; + secrets.keys = lib.flatten (lib.mapAttrsToList (k: v: [ + { + permissions = "0400"; + dest = "backup/${k}/conf"; + text = duplyProfile v "${k}/"; + } + { + permissions = "0400"; + dest = "backup/${k}/exclude"; + text = v.excludeFile; + } + ]) config.services.duplyBackup.profiles); + + services.cron = { + enable = true; + systemCronJobs = let + backups = pkgs.writeScript "backups" '' + #!${pkgs.stdenv.shell} + + ${builtins.concatStringsSep "\n" (lib.mapAttrsToList (k: v: + '' + touch ${varDir}/${k}.log + ${pkgs.duply}/bin/duply ${config.secrets.location}/backup/${k}/ ${action} --force >> ${varDir}/${k}.log + '' + ) config.services.duplyBackup.profiles)} + ''; + in + [ + "0 2 * * * root ${backups}" + ]; + + }; + + security.pki.certificates = let + cert = pkgs.fetchurl { + url = "http://downloads.e.eriomem.net/eriomemca.pem"; + sha256 = "1ixx4c6j3m26j8dp9a3dkvxc80v1nr5aqgmawwgs06bskasqkvvh"; + }; + in [ + (builtins.readFile cert) + ]; + }; +} diff --git a/modules/private/buildbot/default.nix b/modules/private/buildbot/default.nix index 0e63337..8a09139 100644 --- a/modules/private/buildbot/default.nix +++ b/modules/private/buildbot/default.nix @@ -24,7 +24,7 @@ in }; config = lib.mkIf config.myServices.buildbot.enable { - services.backup.profiles.buildbot = { + services.duplyBackup.profiles.buildbot = { rootDir = varDir; }; ids.uids.buildbot = myconfig.env.buildbot.user.uid; diff --git a/modules/private/certificates.nix b/modules/private/certificates.nix index 9de3e6d..337a7fc 100644 --- a/modules/private/certificates.nix +++ b/modules/private/certificates.nix @@ -16,7 +16,7 @@ }; config = lib.mkIf config.myServices.certificates.enable { - services.backup.profiles.system.excludeFile = '' + services.duplyBackup.profiles.system.excludeFile = '' + ${config.security.acme.directory} ''; services.websites.certs = config.myServices.certificates.certConfig; diff --git a/modules/private/ftp.nix b/modules/private/ftp.nix index a1da32f..9b6a98f 100644 --- a/modules/private/ftp.nix +++ b/modules/private/ftp.nix @@ -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 // { diff --git a/modules/private/gitolite/default.nix b/modules/private/gitolite/default.nix index 94ab134..658979d 100644 --- a/modules/private/gitolite/default.nix +++ b/modules/private/gitolite/default.nix @@ -15,7 +15,7 @@ in { snippet = builtins.readFile ./ldap_gitolite.sh; dependencies = [ pkgs.gitolite ]; }]; - services.backup.profiles.gitolite = { + services.duplyBackup.profiles.gitolite = { rootDir = cfg.gitoliteDir; }; networking.firewall.allowedTCPPorts = [ 9418 ]; diff --git a/modules/private/irc.nix b/modules/private/irc.nix index 785b34d..4e6eaab 100644 --- a/modules/private/irc.nix +++ b/modules/private/irc.nix @@ -17,7 +17,7 @@ in }; config = lib.mkIf cfg.enable { - services.backup.profiles.irc = { + services.duplyBackup.profiles.irc = { rootDir = "/var/lib/bitlbee"; }; security.acme.certs."irc" = config.myServices.ircCerts // { diff --git a/modules/private/mail/default.nix b/modules/private/mail/default.nix index d3b2a25..8be21a1 100644 --- a/modules/private/mail/default.nix +++ b/modules/private/mail/default.nix @@ -18,7 +18,7 @@ mxs = map (zone: "mx-1.${zone.name}") zonesWithMx; in builtins.listToAttrs (map (mx: lib.attrsets.nameValuePair mx null) mxs); }; - services.backup.profiles = { + services.duplyBackup.profiles = { mail = { rootDir = "/var/lib"; excludeFile = lib.mkAfter '' diff --git a/modules/private/mail/dovecot.nix b/modules/private/mail/dovecot.nix index dc75e0f..6220da2 100644 --- a/modules/private/mail/dovecot.nix +++ b/modules/private/mail/dovecot.nix @@ -13,7 +13,7 @@ let in { config = lib.mkIf config.myServices.mail.enable { - services.backup.profiles.mail.excludeFile = '' + services.duplyBackup.profiles.mail.excludeFile = '' + /var/lib/dhparams + /var/lib/dovecot ''; diff --git a/modules/private/mail/postfix.nix b/modules/private/mail/postfix.nix index 9fdc7bd..1386f85 100644 --- a/modules/private/mail/postfix.nix +++ b/modules/private/mail/postfix.nix @@ -1,7 +1,7 @@ { lib, pkgs, config, myconfig, ... }: { config = lib.mkIf config.myServices.mail.enable { - services.backup.profiles.mail.excludeFile = '' + services.duplyBackup.profiles.mail.excludeFile = '' + /var/lib/postfix ''; secrets.keys = [ diff --git a/modules/private/mail/rspamd.nix b/modules/private/mail/rspamd.nix index 5e0a239..b5f64d8 100644 --- a/modules/private/mail/rspamd.nix +++ b/modules/private/mail/rspamd.nix @@ -11,7 +11,7 @@ ''; }; config = lib.mkIf config.myServices.mail.enable { - services.backup.profiles.mail.excludeFile = '' + services.duplyBackup.profiles.mail.excludeFile = '' + /var/lib/rspamd ''; services.cron.systemCronJobs = let diff --git a/modules/private/monitoring/default.nix b/modules/private/monitoring/default.nix index 902b2b1..c5acd40 100644 --- a/modules/private/monitoring/default.nix +++ b/modules/private/monitoring/default.nix @@ -27,7 +27,7 @@ in }; config = lib.mkIf config.myServices.monitoring.enable { - services.backup.profiles.monitoring = { + services.duplyBackup.profiles.monitoring = { rootDir = config.services.naemon.varDir; }; security.sudo.extraRules = [ diff --git a/modules/private/mpd.nix b/modules/private/mpd.nix index 759c9d3..c7e2486 100644 --- a/modules/private/mpd.nix +++ b/modules/private/mpd.nix @@ -2,7 +2,7 @@ { options.myServices.mpd.enable = lib.mkEnableOption "enable MPD"; config = lib.mkIf config.myServices.mpd.enable { - services.backup.profiles.mpd = { + services.duplyBackup.profiles.mpd = { rootDir = "/var/lib/mpd"; }; secrets.keys = [ diff --git a/modules/private/pub/default.nix b/modules/private/pub/default.nix index 7eaabc9..835bcec 100644 --- a/modules/private/pub/default.nix +++ b/modules/private/pub/default.nix @@ -15,7 +15,7 @@ snippet = builtins.readFile ./ldap_pub.sh; dependencies = [ pkgs.coreutils ]; }]; - services.backup.profiles.pub = { + services.duplyBackup.profiles.pub = { rootDir = "/var/lib/pub"; }; users.users.pub = let diff --git a/modules/private/system.nix b/modules/private/system.nix index c12c226..1ddfd2e 100644 --- a/modules/private/system.nix +++ b/modules/private/system.nix @@ -1,7 +1,7 @@ { pkgs, privateFiles, lib, ... }: { config = { - services.backup.profiles.system = { + services.duplyBackup.profiles.system = { rootDir = "/var/lib"; excludeFile = lib.mkAfter '' + /var/lib/nixos diff --git a/modules/private/system/eldiron.nix b/modules/private/system/eldiron.nix index 079216b..5384bc2 100644 --- a/modules/private/system/eldiron.nix +++ b/modules/private/system/eldiron.nix @@ -34,7 +34,7 @@ myServices.websites.enable = true; myServices.mail.enable = true; services.pure-ftpd.enable = true; - services.backup.enable = true; + services.duplyBackup.enable = true; deployment = { targetEnv = "hetzner"; diff --git a/modules/private/tasks/default.nix b/modules/private/tasks/default.nix index 88d3b7a..b345e5a 100644 --- a/modules/private/tasks/default.nix +++ b/modules/private/tasks/default.nix @@ -86,7 +86,7 @@ in { }; config = lib.mkIf cfg.enable { - services.backup.profiles.tasks = { + services.duplyBackup.profiles.tasks = { rootDir = "/var/lib"; excludeFile = '' + /var/lib/taskserver diff --git a/modules/private/websites/aten/integration.nix b/modules/private/websites/aten/integration.nix index 0c92818..7aadf58 100644 --- a/modules/private/websites/aten/integration.nix +++ b/modules/private/websites/aten/integration.nix @@ -8,7 +8,7 @@ in { options.myServices.websites.aten.integration.enable = lib.mkEnableOption "enable Aten's website in integration"; config = lib.mkIf cfg.enable { - services.backup.profiles.aten_dev.rootDir = app.varDir; + services.duplyBackup.profiles.aten_dev.rootDir = app.varDir; services.phpApplication.apps.aten_dev = { websiteEnv = "integration"; httpdUser = config.services.httpd.Inte.user; diff --git a/modules/private/websites/aten/production.nix b/modules/private/websites/aten/production.nix index 2ffcef3..16a909a 100644 --- a/modules/private/websites/aten/production.nix +++ b/modules/private/websites/aten/production.nix @@ -8,7 +8,7 @@ in { options.myServices.websites.aten.production.enable = lib.mkEnableOption "enable Aten's website in production"; config = lib.mkIf cfg.enable { - services.backup.profiles.aten_prod.rootDir = app.varDir; + services.duplyBackup.profiles.aten_prod.rootDir = app.varDir; services.webstats.sites = [ { name = "aten.pro"; } ]; services.phpApplication.apps.aten_prod = { websiteEnv = "production"; diff --git a/modules/private/websites/chloe/integration.nix b/modules/private/websites/chloe/integration.nix index 75e25af..00c76a5 100644 --- a/modules/private/websites/chloe/integration.nix +++ b/modules/private/websites/chloe/integration.nix @@ -12,7 +12,7 @@ in { options.myServices.websites.chloe.integration.enable = lib.mkEnableOption "enable Chloe's website in integration"; config = lib.mkIf cfg.enable { - services.backup.profiles.chloe_dev.rootDir = chloe.app.varDir; + services.duplyBackup.profiles.chloe_dev.rootDir = chloe.app.varDir; secrets.keys = chloe.keys; systemd.services.phpfpm-chloe_dev.after = lib.mkAfter chloe.phpFpm.serviceDeps; systemd.services.phpfpm-chloe_dev.wants = chloe.phpFpm.serviceDeps; diff --git a/modules/private/websites/chloe/production.nix b/modules/private/websites/chloe/production.nix index 7c59806..0562de8 100644 --- a/modules/private/websites/chloe/production.nix +++ b/modules/private/websites/chloe/production.nix @@ -12,7 +12,7 @@ in { options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production"; config = lib.mkIf cfg.enable { - services.backup.profiles.chloe_prod.rootDir = chloe.app.varDir; + services.duplyBackup.profiles.chloe_prod.rootDir = chloe.app.varDir; secrets.keys = chloe.keys; services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ]; diff --git a/modules/private/websites/connexionswing/integration.nix b/modules/private/websites/connexionswing/integration.nix index fee8e4f..54dbf54 100644 --- a/modules/private/websites/connexionswing/integration.nix +++ b/modules/private/websites/connexionswing/integration.nix @@ -8,7 +8,7 @@ in { options.myServices.websites.connexionswing.integration.enable = lib.mkEnableOption "enable Connexionswing's website in integration"; config = lib.mkIf cfg.enable { - services.backup.profiles.connexionswing_dev.rootDir = app.varDir; + services.duplyBackup.profiles.connexionswing_dev.rootDir = app.varDir; services.phpApplication.apps.connexionswing_dev = { websiteEnv = "integration"; httpdUser = config.services.httpd.Inte.user; diff --git a/modules/private/websites/connexionswing/production.nix b/modules/private/websites/connexionswing/production.nix index 79e672a..af37e29 100644 --- a/modules/private/websites/connexionswing/production.nix +++ b/modules/private/websites/connexionswing/production.nix @@ -8,7 +8,7 @@ in { options.myServices.websites.connexionswing.production.enable = lib.mkEnableOption "enable Connexionswing's website in production"; config = lib.mkIf cfg.enable { - services.backup.profiles.connexionswing_prod.rootDir = app.varDir; + services.duplyBackup.profiles.connexionswing_prod.rootDir = app.varDir; services.webstats.sites = [ { name = "connexionswing.com"; } ]; services.phpApplication.apps.connexionswing_prod = { websiteEnv = "production"; diff --git a/modules/private/websites/default.nix b/modules/private/websites/default.nix index 119d62e..87fdd73 100644 --- a/modules/private/websites/default.nix +++ b/modules/private/websites/default.nix @@ -77,7 +77,7 @@ in }; config = lib.mkIf config.myServices.websites.enable { - services.backup.profiles.php = { + services.duplyBackup.profiles.php = { rootDir = "/var/lib/php"; }; users.users.wwwrun.extraGroups = [ "keys" ]; diff --git a/modules/private/websites/emilia/production.nix b/modules/private/websites/emilia/production.nix index 0dab316..5bf39c9 100644 --- a/modules/private/websites/emilia/production.nix +++ b/modules/private/websites/emilia/production.nix @@ -43,7 +43,7 @@ in { options.myServices.websites.emilia.production.enable = lib.mkEnableOption "enable Emilia's website"; config = lib.mkIf cfg.enable { - services.backup.profiles.emilia_prod = { + services.duplyBackup.profiles.emilia_prod = { rootDir = varDir; }; system.activationScripts.emilia = '' diff --git a/modules/private/websites/florian/app.nix b/modules/private/websites/florian/app.nix index 7e2c333..e6e16fa 100644 --- a/modules/private/websites/florian/app.nix +++ b/modules/private/websites/florian/app.nix @@ -9,7 +9,7 @@ in { options.myServices.websites.florian.app.enable = lib.mkEnableOption "enable Florian's app in integration"; config = lib.mkIf cfg.enable { - services.backup.profiles.tellesflorian_dev.rootDir = app.varDir; + services.duplyBackup.profiles.tellesflorian_dev.rootDir = app.varDir; services.phpApplication.apps.florian_dev = { websiteEnv = "integration"; httpdUser = config.services.httpd.Inte.user; diff --git a/modules/private/websites/ludivinecassal/integration.nix b/modules/private/websites/ludivinecassal/integration.nix index d1b8f9b..5d9afc1 100644 --- a/modules/private/websites/ludivinecassal/integration.nix +++ b/modules/private/websites/ludivinecassal/integration.nix @@ -8,7 +8,7 @@ in { options.myServices.websites.ludivinecassal.integration.enable = lib.mkEnableOption "enable Ludivine's website in integration"; config = lib.mkIf cfg.enable { - services.backup.profiles.ludivinecassal_dev.rootDir = app.varDir; + services.duplyBackup.profiles.ludivinecassal_dev.rootDir = app.varDir; services.phpApplication.apps.ludivinecassal_dev = { websiteEnv = "integration"; httpdUser = config.services.httpd.Inte.user; diff --git a/modules/private/websites/ludivinecassal/production.nix b/modules/private/websites/ludivinecassal/production.nix index 341fd6d..1a8b958 100644 --- a/modules/private/websites/ludivinecassal/production.nix +++ b/modules/private/websites/ludivinecassal/production.nix @@ -8,7 +8,7 @@ in { options.myServices.websites.ludivinecassal.production.enable = lib.mkEnableOption "enable Ludivine's website in production"; config = lib.mkIf cfg.enable { - services.backup.profiles.ludivinecassal_prod.rootDir = app.varDir; + services.duplyBackup.profiles.ludivinecassal_prod.rootDir = app.varDir; services.webstats.sites = [ { name = "ludivinecassal.com"; } ]; services.phpApplication.apps.ludivinecassal_prod = { websiteEnv = "production"; diff --git a/modules/private/websites/piedsjaloux/integration.nix b/modules/private/websites/piedsjaloux/integration.nix index 853fcff..8d7cf3a 100644 --- a/modules/private/websites/piedsjaloux/integration.nix +++ b/modules/private/websites/piedsjaloux/integration.nix @@ -8,7 +8,7 @@ in { options.myServices.websites.piedsjaloux.integration.enable = lib.mkEnableOption "enable PiedsJaloux's website in integration"; config = lib.mkIf cfg.enable { - services.backup.profiles.piedsjaloux_dev.rootDir = app.varDir; + services.duplyBackup.profiles.piedsjaloux_dev.rootDir = app.varDir; services.phpApplication.apps.piedsjaloux_dev = { websiteEnv = "integration"; httpdUser = config.services.httpd.Inte.user; diff --git a/modules/private/websites/piedsjaloux/production.nix b/modules/private/websites/piedsjaloux/production.nix index 9e64fca..2267e03 100644 --- a/modules/private/websites/piedsjaloux/production.nix +++ b/modules/private/websites/piedsjaloux/production.nix @@ -8,7 +8,7 @@ in { options.myServices.websites.piedsjaloux.production.enable = lib.mkEnableOption "enable PiedsJaloux's website in production"; config = lib.mkIf cfg.enable { - services.backup.profiles.piedsjaloux_prod.rootDir = app.varDir; + services.duplyBackup.profiles.piedsjaloux_prod.rootDir = app.varDir; services.webstats.sites = [ { name = "piedsjaloux.fr"; } ]; services.phpApplication.apps.piedsjaloux_prod = { websiteEnv = "production"; diff --git a/modules/private/websites/tools/diaspora/default.nix b/modules/private/websites/tools/diaspora/default.nix index 24d3d51..20ae055 100644 --- a/modules/private/websites/tools/diaspora/default.nix +++ b/modules/private/websites/tools/diaspora/default.nix @@ -10,7 +10,7 @@ in { }; config = lib.mkIf cfg.enable { - services.backup.profiles.diaspora = { + services.duplyBackup.profiles.diaspora = { rootDir = dcfg.dataDir; }; users.users.diaspora.extraGroups = [ "keys" ]; diff --git a/modules/private/websites/tools/ether/default.nix b/modules/private/websites/tools/ether/default.nix index 600254b..62a1691 100644 --- a/modules/private/websites/tools/ether/default.nix +++ b/modules/private/websites/tools/ether/default.nix @@ -12,7 +12,7 @@ in { }; config = lib.mkIf cfg.enable { - services.backup.profiles.etherpad-lite = { + services.duplyBackup.profiles.etherpad-lite = { rootDir = "/var/lib/private/etherpad-lite"; }; secrets.keys = [ diff --git a/modules/private/websites/tools/mail/default.nix b/modules/private/websites/tools/mail/default.nix index 35711af..218c3a5 100644 --- a/modules/private/websites/tools/mail/default.nix +++ b/modules/private/websites/tools/mail/default.nix @@ -17,7 +17,7 @@ in ]; config = lib.mkIf cfg.enable { - services.backup.profiles.mail.excludeFile = '' + services.duplyBackup.profiles.mail.excludeFile = '' + ${rainloop.varDir} + ${roundcubemail.varDir} ''; diff --git a/modules/private/websites/tools/mastodon/default.nix b/modules/private/websites/tools/mastodon/default.nix index 2236bd5..97f2452 100644 --- a/modules/private/websites/tools/mastodon/default.nix +++ b/modules/private/websites/tools/mastodon/default.nix @@ -10,7 +10,7 @@ in { }; config = lib.mkIf cfg.enable { - services.backup.profiles.mastodon = { + services.duplyBackup.profiles.mastodon = { rootDir = mcfg.dataDir; }; secrets.keys = [{ diff --git a/modules/private/websites/tools/tools/default.nix b/modules/private/websites/tools/tools/default.nix index 6f27b0b..3cf3e8e 100644 --- a/modules/private/websites/tools/tools/default.nix +++ b/modules/private/websites/tools/tools/default.nix @@ -51,7 +51,7 @@ in { ++ wallabag.keys ++ yourls.keys; - services.backup.profiles = { + services.duplyBackup.profiles = { dokuwiki = dokuwiki.backups; kanboard = kanboard.backups; rompr = rompr.backups; diff --git a/modules/webapps/webstats/default.nix b/modules/webapps/webstats/default.nix index 6771f01..e822645 100644 --- a/modules/webapps/webstats/default.nix +++ b/modules/webapps/webstats/default.nix @@ -37,7 +37,7 @@ in { }; config = lib.mkIf (builtins.length cfg.sites > 0) { - services.backup.profiles.goaccess = { + services.duplyBackup.profiles.goaccess = { rootDir = cfg.dataDir; }; users.users.root.packages = [ -- cgit v1.2.3