X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fdatabases%2Fredis_replication.nix;h=a3fe3bb775f0f412d846bc80f7b9049035fe38f6;hb=3c50eea8d946bf8417f49fa8a4a6e109e0439c7b;hp=cc626f56b7d8db6cdb0275eaf1b2dadc0bfaa203;hpb=dded66995529a0419cc56778f4ebb4247c2ab765;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/databases/redis_replication.nix b/modules/private/databases/redis_replication.nix index cc626f5..a3fe3bb 100644 --- a/modules/private/databases/redis_replication.nix +++ b/modules/private/databases/redis_replication.nix @@ -1,4 +1,4 @@ -{ pkgs, config, myconfig, lib, ... }: +{ pkgs, config, lib, ... }: let cfg = config.myServices.databasesReplication.redis; in @@ -63,7 +63,7 @@ in config.redis = { encrypt = true; source = "127.0.0.1:16379"; - target = "${myconfig.env.servers.eldiron.ips.main.ip4}:16379"; + target = "${config.myEnv.servers.eldiron.ips.main.ip4}:16379"; keyfile = "${config.secrets.location}/redis/spiped_eldiron_keyfile"; }; }; @@ -103,7 +103,7 @@ in user = "spiped"; group = "spiped"; permissions = "0400"; - text = myconfig.env.databases.redis.spiped_key; + text = config.myEnv.databases.redis.spiped_key; } ]; @@ -117,7 +117,7 @@ in #!${pkgs.stdenv.shell} ${pkgs.coreutils}/bin/cp ${cfg.base}/${name}/redis/dump.rdb \ - ${backupDir}/$(${pkgs.coreutils}/bin/date -Iseconds).rdb + ${backupDir}/$(${pkgs.coreutils}/bin/date -Iminutes).rdb ''; u = pkgs.callPackage ./utils.nix {}; cleanup_script = pkgs.writeScript "cleanup_redis_${name}" (u.exponentialDumps "rdb" backupDir);