From 8d4ad4d50c104670b7ef97089dc4df279e13966d Mon Sep 17 00:00:00 2001 From: WilliButz Date: Thu, 13 Jul 2023 11:58:28 +0200 Subject: [PATCH] flake: patch migrate.py to discover system_migrations Previously "system_migrations" were silently not applied, because the migration script tries to find them relatively to its own location, but here they are not in the same /bin folder that migrate.py is placed in. --- flake.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake.nix b/flake.nix index 93d3722..a26547e 100644 --- a/flake.nix +++ b/flake.nix @@ -164,6 +164,10 @@ cp ${authentik-src}/lifecycle/migrate.py $out/bin/migrate.py chmod +w $out/bin/migrate.py patchShebangs $out/bin/migrate.py + substituteInPlace $out/bin/migrate.py \ + --replace \ + 'migration in Path(__file__).parent.absolute().glob("system_migrations/*.py")' \ + 'migration in Path("${staticWorkdirDeps}/lifecycle").glob("system_migrations/*.py")' wrapProgram $out/bin/migrate.py \ --prefix PATH : ${pythonEnv}/bin \ --prefix PYTHONPATH : ${staticWorkdirDeps}