I’m trying to create a nixops file to configure a webserver with php-fpm and the caddy webserver. I need to reference the location of the php-fpm socket in the caddy configuration. According to the NixOS options docs, this is available in the phpfpm.pools.<name>.socket option, but when trying to use it I’m getting error: attribute 'socket' missing
. Here’s my code:
let
users = {
users.sephi = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
};
in
{
network.enableRollback = true;
myserver = { config, pkgs, ... }: {
deployment.targetHost = "...";
networking.firewall.allowedTCPPorts = [ 80 443 22 ];
containers.bookstack =
{ config = rec {
services.phpfpm.pools.default = {
user = "php";
group = "php";
phpPackage = pkgs.php;
};
services.caddy = {
enable = true;
agree = true;
config = ''
auto_https off
root * /var/www
php_fastcgi ${services.phpfpm.pools.default.socket};
file_server
'';
};
};
autoStart = true;
};
inherit users;
};
}
I guess the problem comes from the fact that the phpfpm.pools.<name>.socket
option is not defined at the time of evaluation in the services.caddy.config
string? How can I access this value?