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
farge: init at 1.0.8 #93793
farge: init at 1.0.8 #93793
Conversation
Hello :) I'm not a nixpkgs guru. But I would add two things:
|
sha256 = "08z7dgc3wygl6s922s4gsi2fkrfmghzy82ivnivxr293b9mll7ar"; | ||
}; | ||
|
||
propagatedBuildInputs = with pkgs; |
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.
Also, is there a reason this isn't buildInputs
? I don't see why these inputs should be propagated...
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.
I added them as propagated because farge needs these programs on path at runtime, and my impression of the difference is that buildInputs
doesn't do this. Maybe I misunderstand the difference?
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.
I think the main difference between propagatedBuildInputs and buildInputs is that: If a derivation A has a derivation B in its buildInputs, and derivation B has some derivations C, D, E in its propagatedBuildInputs, then A can see B, C, D and E in its PATH
variable at build-time (and therefore A can, for example, save the path to C, D and E and execute them later at run-time). If C, D, and E are in the buildInputs (instead of propagatedBuildInputs) of B, then A only has B in its PATH
at run-time. I hope someone corrects me if I'm wrong 🙃
But, I'm fairly certain that Nix doesn't "sandbox" any executables by default. What I mean is that the environment in which farge runs is the same as the environment from which it is executed, so PATH
isn't changed by Nix, and farge
can't find its buildInputs at run-time. But, this can be fixed easily, using the makeWrapper
and wrapProgram
shell functions from stdenv. I always use ripgrep to find out real-world examples of how to use NIx functions, and it seems you can just do something like this: wrapProgram $out/bin/farge --prefix PATH : ${stdenv.lib.makeBinPath buildInputs}
(in postInstall
for example) to make all buildInputs visible to farge via the PATH
variable at run-time.
Now, I wonder how you got the packages available at run-time, though. Could it be that you already have wl-clipboard, slurp and grim installed in your user environment, maybe? Or ran farge from nix-shell
? If not, I have probably misunderstood something.
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.
@laikq You're very much on point with your explanation, nice!
@laikq Thank you for the feedback! I suspected it wouldn't work on X11 as it does require |
726a9ae
to
3317b28
Compare
wrapProgram "$out/bin/farge" --prefix PATH : "${lib.makeBinPath buildInputs}" | ||
''; | ||
|
||
meta = with stdenv.lib; { |
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.
meta = with stdenv.lib; { | |
meta = with lib; { |
version = "1.0.8"; | ||
src = fetchFromGitHub { |
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.
version = "1.0.8"; | |
src = fetchFromGitHub { | |
version = "1.0.8"; | |
src = fetchFromGitHub { |
I marked this as stale due to inactivity. → More info |
Closing due to inactivity from author. |
Motivation for this change
I like using farge for picking colors, since there doesn't seem to be a solid equivalent on Wayland.
I'm also excited to make my first contribution to
nixpkgs
.Things done
sandbox
innix.conf
on non-NixOS linux) (only tested in Wayland)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)