# Trying to create my first package variant - How do I add a patch?

**URL:** <https://forum.systemcrafters.net/t/trying-to-create-my-first-package-variant-how-do-i-add-a-patch/2008>\
**Category:** Guix\
**Created:** [May 13, 2026, 12:32am UTC](https://forum.systemcrafters.net/t/trying-to-create-my-first-package-variant-how-do-i-add-a-patch/2008 "2026-05-13T00:32:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Folaht](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/folaht/32/1145_2.png) [@Folaht](https://forum.systemcrafters.net/u/Folaht)\
**Post date:** [May 16, 2026, 7:24am UTC](https://forum.systemcrafters.net/t/trying-to-create-my-first-package-variant-how-do-i-add-a-patch/2008/2 "2026-05-16T07:24:17Z")

</div>

Alright, I went from `(patches xkeyboard-config-yr-patch)` to `(patches (list xkeyboard-config-yr-patch))` and that compiles.

However, I don’t know which package my system is using now and it doesn’t seem to be applied, even though it applies fine from the source code.  
But when I look up the package ?I think my system is using? through `realpath $(guix build xkeyboard-config)` and `guix package -I | grep xkeyboard-config` it does show the patch applied however.

[edit]

It looks like the patch is nowhere to be seen when I try a `guix upgrade`.

```shell
$ guix upgrade
guix upgrade: error: canonicalize-path: No such file or directory: "xkeyboard-config-yr.patch"

```

---

_[View the full topic](https://forum.systemcrafters.net/t/trying-to-create-my-first-package-variant-how-do-i-add-a-patch/2008)._
