myphps/nixos/default.nix
2025-04-13 17:13:51 +02:00

35 lines
665 B
Nix

phps: {
lib,
config,
...
}: let
cfg = config.programs.phps;
inherit (lib) types;
in {
options.services.phps = {
enable = lib.mkEnableOption "phps";
phps = lib.mkOption {
description = ''
PHPs to use.
'';
default = phps;
type = types.attrsOf types.package;
};
prefix = lib.mkOption {
description = ''
The prefix for every PHP installation.
'';
default = "/var/lib/phps";
type = types.str;
};
};
config = {
systemd.tmpfiles.settings =
builtins.mapAttrs (name: drv: {
"${cfg.prefix}/${name}"."L+".argument = drv.outPath;
})
phps;
};
}