-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slock: adds ability to add custom patches #29108
Conversation
@Gerschtli, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mt-caret, @astsmtl and @pSub to be potential reviewers. |
How about using: {
nixpkgs.config.packageOverrides = pkgs: {
slock = pkgs.slock.overrideDerivation (old: {
patches = [ ./patch.diff ];
});
};
} instead? |
patchPhase = "sed -i '/chmod u+s/d' Makefile"; | ||
inherit patches; | ||
|
||
postPatch = "sed -i '/chmod u+s/d' Makefile"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The postPatch
looks good to me though. So I would only remove inherit patches;
.
@Mic92 This does not work. My current workaround is {
nixpkgs.config.packageOverrides = pkgs: {
slock = pkgs.lib.overrideDerivation pkgs.slock (attrs: {
patchPhase = attrs.patchPhase + " && patch < " + ./patch.diff;
});
};
} Not really a nice solution I think.. |
To be sure we are on the same page: You say if you rename |
That would work, but why use this method if it isn't a problem to make the usage easier without any drawbacks? |
Hey, whats the status? |
The drawbacks is, that it pulls |
It also promotes an API, where it is unclear, if we can add our own |
I can't see the difference why this ( https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/window-managers/dwm/default.nix ) is okay, but here it isn't |
The difference between |
So if I would edit the line for slock in all-packages.nix, would it be okay? |
You can also expose |
Sounds good to me. Could you please tell me, where the slock package is called? I can't find the line in all-packages.nix... |
00de7ac
to
c1d41b1
Compare
I have updated the PR, but I really can't see the benefit of using |
c1d41b1
to
522d73d
Compare
I'd love to see this PR merged and be available in 17.09. Thanks for creating this patch and reviewing it. |
I'm strongly opposed to this. I don't want to promote this kind of API. I'd propose renaming Sorry for not stating this earlier but this PR had slipped past me. |
Is this parameter meant to be used with https://tools.suckless.org/slock/patches/ ?
Maybe extra options like Edit: I mean, to write
instead. |
I'm strongly against adding options for every possible patch out there. This would imply that you know every patch out there (not just the patches on the slock-webpage) and that other patches aren't worth it. I'm a friend of a simple patch-list like in the |
@geistesk I think these patches provided by upstream are more like "extra features" than "extra patches". If we let user to fetch the patches themselves or let user to use their own patches, the patch may not be applicable anymore when And if users really need to add custom patches, they can use method mentioned by @globin |
@sifmelcara These patches are created against different versions (tags and commits) and are user-submitted. So it's perhaps not possible to merge them automatically into the latest version. Honestly I don't care how I'll patch it, as long as I'm able to patch it. My current nixpkgs.config.packageOverrides = pkgs: {
slock = pkgs.slock.overrideAttrs(oldAttrs: rec {
patches = [ /etc/nixos/patches/slock-dpms-20170923-fa11589.diff ];
});
}; |
522d73d
to
67120e2
Compare
I think the way, I have adapted the PR should be okay because
@globin I understand now why you don't want such interfaces, sounds logical ;) |
Motivation for this change
I needed to add patches to slock so I added the patches argument.
Usage:
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)