Fediversity/deployment/utils.nix
Kiara Grouwstra f5b8304475
properly propagate modulesPath
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
2025-10-24 11:11:22 +02:00

30 lines
529 B
Nix

{
pkgs,
lib,
inputs ? null,
...
}:
{
evalModel =
module:
(lib.evalModules {
specialArgs = {
inherit pkgs inputs;
modulesPath = "${builtins.toString pkgs.path}/nixos/modules";
};
modules = [
./data-model.nix
module
];
}).config;
toBash =
v:
lib.replaceStrings [ "\"" ] [ "\\\"" ] (
if lib.isPath v || builtins.isNull v then
toString v
else if lib.isString v then
v
else
lib.strings.toJSON v
);
}