Hey there,
I’ve created an github-issue on one of my favorite kde-extensions: https://github.com/matinlotfali/KDE-Rounded-Corners/issues/348
Now there is a new branch available on that git and i want to test it out to give some feedback.
The required change in the buildfile (https://github.com/NixOS/nixpkgs/blob/d89fc19e405cb2d55ce7cc114356846a0ee5e956/pkgs/data/themes/kwin-decorations/kde-rounded-corners/default.nix) seems to be to just replace the “rev” parameter with the branch. But I am not able to do that.
I am using a flake-based system and I am not really sure how to do that. There are several options for that:
- clone nixpkgs and import in in flakes inputs → i was able to edit my clone and import it as a flake input → but i didn’t figured out how to access the package “inputs.myrepo.kde-rounded-corners” didn’t worked
- implement an overlay → I’ve found lots of documentation for that → but nothing worked for me - I just wasn’t able to find out how to import my overlay and where to define it
- package-override → no glue how that works
I am just a bit confused about all the options and all the bad documentation.
What is the best option to modify the package? How should I do that then?
My problem looks a bit easy on a the surface but I am just confused about all that.
I hope anyone can guide me through this.
Thank you all an best regards
rkunschke
More information would help us help you here: either your configuration before you attempted this (so we can tell how the extension is installed), or one of your failed attempts together with the errors you got (if any).
Thank you. Seems like I found my problem. I’ve now created a overlay in my configuration.nix :
{
pkgs,
...
}:
{
imports = [
./../../modules/collect.nix
./../../modules/collectPc.nix
];
collect.enable = true;
collectPc.enable = true;
system.stateVersion = "25.05"; # Did you read the comment?
environment.systemPackages = [ pkgs.kde-rounded-corners ];
nixpkgs.overlays = [
(
final: prev:
# overlay goes here
{
kde-rounded-corners = prev.kde-rounded-corners.overrideAttrs (old: {
src = prev.fetchFromGitHub {
owner = "matinlotfali";
repo = "KDE-Rounded-Corners";
rev = "348-disable-round-corners-on-zero-roundness";
hash = "sha256-MI/AK08ZJianEZKX5yo+H1u08iiLBXpNEskfVeKiRfE=";
};
});
})
];
}
I’ve just combiened these two examples in the nixos wiki:
https://nixos.wiki/wiki/Overlays#In_NixOS
https://nixos.wiki/wiki/Overlays#Overriding_a_version
That worked for me now. My error last time was to not define the “src.owner” and the “src.repo” which resulted in a error message. I didn’t understood that message after hours of trying out. Sometimes taking a break is better than trying and trying.
What i didn’t understand about that is why i need to define them as they where defined in the original file and i just wanted to change “src.rev” and “src.hash”. I thought only the attributes I define in my overlay are modified (“src.rev” and “src.hash”) but it seems like the whole “src” attribute is replaced.
Just for my understanding: Is it possible to just replace “src.rev” and “src.hash” without replacing “src” as a whole?
Usually I see people override src
as a whole. As fetchFromGitHub
is also a derivation, you can use override
on it too - this seems to work, although I haven’t tested past trying to build it.
prev.kde-rounded-corners.overrideAttrs (old: {
src = old.src.override {
rev = "348-disable-round-corners-on-zero-roundness";
hash = "sha256-MI/AK08ZJianEZKX5yo+H1u08iiLBXpNEskfVeKiRfE=";
};
})
It is recommended to use the official wiki instead Overlays - NixOS Wiki .
Thank you for that information. Now I have a better understanding on how “old” works.
I’ve never noticed there were two nixos-wikis. That information might make it easier to look for solutions in the future.