From 41187bb18fa8fa9387e33b42bd25f53169ec7852 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Wed, 13 Jul 2022 14:08:29 +0300 Subject: [PATCH] Read value directly from json --- files.nix | 2 +- variables-module.nix | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/files.nix b/files.nix index 9806e31..9110e8c 100644 --- a/files.nix +++ b/files.nix @@ -5,7 +5,7 @@ in { systemd.tmpfiles.rules = let - nextcloudDBPass = builtins.replaceStrings [ "\n" "\"" "\\" "%" ] [ "\\n" "\\\"" "\\\\" "%%" ] cfg.nextcloud.databasePassword; + nextcloudDBPass = builtins.replaceStrings [ "\n" "\"" "\\" "%" ] [ "\\n" "\\\"" "\\\\" "%%" ] (builtins.fromJSON (builtins.readFile ./userdata/userdata.json).nextcloud.databasePassword); nextcloudAdminPass = builtins.replaceStrings [ "\n" "\"" "\\" "%" ] [ "\\n" "\\\"" "\\\\" "%%" ] cfg.nextcloud.adminPassword; resticPass = builtins.replaceStrings [ "\n" "\"" "\\" "%" ] [ "\\n" "\\\"" "\\\\" "%%" ] cfg.resticPassword; domain = builtins.replaceStrings [ "\n" "\"" "\\" "%" ] [ "\\n" "\\\"" "\\\\" "%%" ] cfg.domain; diff --git a/variables-module.nix b/variables-module.nix index 47acdfb..9df33cd 100644 --- a/variables-module.nix +++ b/variables-module.nix @@ -141,12 +141,12 @@ in default = true; type = types.nullOr types.bool; }; - databasePassword = mkOption { - description = '' - Password for the nextcloud database - ''; - type = types.nullOr types.str; - }; + # databasePassword = mkOption { + # description = '' + # Password for the nextcloud database + # ''; + # type = types.nullOr types.str; + # }; adminPassword = mkOption { description = '' Password for the nextcloud admin user