myphps/nixos/default.nix

35 lines
669 B
Nix
Raw Normal View History

2025-04-13 15:13:51 +00:00
phps: {
lib,
config,
...
}: let
cfg = config.programs.phps;
inherit (lib) types;
in {
2025-04-13 15:18:18 +00:00
options.services.myphps = {
enable = lib.mkEnableOption "myphps";
2025-04-13 15:13:51 +00:00
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;
};
}