How do I find out which patches where applied to a package?

Currently, I’m trying to fix a problem in nixos where kate’s KAuth integration isn’t working. I’m thinking it might be disabled via a patch like opensuse did awhile back. So I’m trying to look at the source of packages (kate and ktexteditor) to see if I can find such a patch (so that I may overwrite it) but have so far not located anything in the code that lists it.

Is there something like a dpkg-source for nix?
Or some better way to find out which patches (if any) were applied to kate/ktexteditor?

By searching for kate you can go to the source in github where any relevant patching is commonly done in prePatch, patches, patchPhase or postPatch.

A tool which computes a report / diff of any patch applied in a derivation would be great, but i don’t know whether it exists…

It isn’t in the friendliest form, but you could also skim the derivation to see how it was patched (i.e., nix show-derivation /nix/store/..., note the contents of the patches and prePatch postPatch and patchPhase keys if present, etc.).

1 Like

When I run

nix show-derivation /nix/store/j72zn8vm5is69k2pw0b947hqncmz57n6-ktexteditor-5.106.0

All I get is:

error: experimental Nix feature ‘nix-command’ is disabled; use ‘–extra-experimental-features nix-command’ to override

So, try what it suggests?

nix --extra-experimental-features nix-command show-derivation /nix/store/j72zn8vm5is69k2pw0b947hqncmz57n6-ktexteditor-5.106.0
1 Like

Thanks that works.

Note: I didn’t understand what it meant. At first I ran: nix --extra-experimental-features show-derivation /nix/store/j72zn8vm5is69k2pw0b947hqncmz57n6-ktexteditor-5.106.0 (without nix-command) thinking they show-derivation would be the command.

1 Like