module(wp): pass through wp config secrets

This commit is contained in:
Raito Bezarius 2021-11-22 21:59:18 +01:00
parent 86b6f7eb31
commit 98d9e0c140

View file

@ -3,7 +3,11 @@ with lib;
let
cfg = config.services.wordpress;
callPackage = pkgs.callPackage;
appConfig = (import ./default-app-config.nix).extend (self: super: { });
appConfig = (import ./default-app-config.nix).extend (self: super: {
wpConfig = super.wpConfig.extend (self: super: {
secrets = cfg.wpConfigSecrets;
});
});
writeableDataPath = "/var/lib/phpfpm/${appConfig.name}";
phpFpmListen = "/run/phpfpm/wordpress-pool.sock";
phpIni = import ./php-config.nix { inherit pkgs config appConfig;
@ -22,6 +26,9 @@ in {
disabledModules = [ "services/web-apps/wordpress.nix" ];
options.services.wordpress = {
enable = mkEnableOption "Enable the WordPress module";
wpConfigSecrets = mkOption {
type = types.str;
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.wp-cli ];