That might be the workaround I am looking for.
The thing I am trying to avoid is that nix flake lock needs internet access to get the newest nixpkgs. For the sake of development I would like to lock it to the thing I have already in nix store.
When I apply the workaround the flake.nix is not complete. So I should revert the workaround before I push the commit. It gets needlessly complicated :(.