nix-godot-with-modules/godot-withmodules.nix
2025-02-22 22:24:06 -05:00

22 lines
522 B
Nix

pkgs@{
lib,
godot ? pkgs.godot_4,
...
}:
godot.overrideAttrs (prev: {
passthru = prev.passthru // {
withModules =
modules:
godot.overrideAttrs (prev: {
postPatch =
if prev ? "postPatch" then prev.postPatch else ""
+ (lib.strings.concatLines (
builtins.map (module:
''
cp -ar ${module.path} modules/${module.name}
chmod -R u+w -- "modules/${module.name}"
'') modules
));
});
};
})