Overlays: Difference between revisions
imported>Symphorien m fix heading level |
imported>Symphorien example of overriding a scope |
||
Line 144: | Line 144: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Overriding a package inside a scope === | |||
Some packages are not in the top level of nixpkgs but inside a ''scope''. For example all [[GNOME]] packages are in the <code>gnome3</code> attribute set and [[Xfce]] packages inside <code>xfce</code>. These attributes are often ''scopes'' and must be overriden specially. Here is an example of patching <code>xfce.xfce4-terminal</code>. | |||
<syntaxhighlight lang="nix"> | |||
# elements of nixpkgs must be taken from self and super | |||
self: super: | |||
{ | |||
xfce = super.xfce.overrideScope' ( | |||
# elements of pkgs.xfce must be taken from selfx and superx | |||
selfx: superx: { | |||
xfce4-terminal = superx.xfce4-terminal.overrideAttrs ( | |||
old: { | |||
patches = (old.patches or []) ++ [ | |||
( | |||
# https://bugzilla.xfce.org/show_bug.cgi?id=16682 | |||
super.fetchpatch { | |||
url = "https://bugzilla.xfce.org/attachment.cgi?id=9709"; | |||
sha256 = "1shxzzvwsybri772lbm17rpd1l0g9y2vc7f7xgqlgkgz72wzr5zp"; | |||
} | |||
) | |||
]; | |||
} | |||
); | |||
} | |||
); | |||
} | |||
</syntaxhighlight> | |||
=== Python Packages Overlay === | === Python Packages Overlay === | ||