Skip to content
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

bitcoin: install desktop file and pixmaps #72418

Merged
merged 1 commit into from Dec 14, 2019

Conversation

offlinehacker
Copy link
Contributor

Motivation for this change

Add desktop file and pixmaps, so we have better intergration

Things done

I had to switch source from one on bitcoin.org to github, as distributed package does not include pixmaps. This is also something that archlinux uses.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @roconnor

pkgs/applications/blockchains/bitcoin.nix Outdated Show resolved Hide resolved
Copy link
Contributor

@jb55 jb55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! ACK 8d6d7b8ad6593c213bc29bf1d5d4bcc47c49dbe9

@roconnor roconnor mentioned this pull request Nov 30, 2019
10 tasks
@Lassulus
Copy link
Member

Lassulus commented Dec 8, 2019

superseded by #74741

@Lassulus Lassulus closed this Dec 8, 2019
@roconnor
Copy link
Contributor

#74741 didn't implement the desktop file and pixmaps, so I'm reopening this PR. It will need to rebased, but I think we can proceed after that.

@offlinehacker
Copy link
Contributor Author

Rebased and implemented suggested changes, should be good to merge

@roconnor
Copy link
Contributor

If you are okay with it, I'd prefer if you move the desktop and pixmap assignments into a let expression surrounding the mkDerivation (and drop the optional). Then use splices in the postInstall as follows:

postInstall = optional withGui ''
  install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop
  install -Dm644 ${pixmap} $out/share/pixmaps/bitcoin128.png
'';

While it is a somewhat a matter of preference, I prefer to have lazy evaluation manage what does and does not need to be downloaded.

@roconnor
Copy link
Contributor

roconnor commented Dec 12, 2019

Ah, you'll need to float the version number out into the let expression too and inherit it. I think I'm okay with that.

grep "let version" pkgs -R suggests that this is not an uncommon thing to do.

@offlinehacker
Copy link
Contributor Author

offlinehacker commented Dec 12, 2019

While it is a somewhat a matter of preference, I prefer to have lazy evaluation manage what does and does not need to be downloaded.

Download is lazy already due optional, I do not see benefit here.

@offlinehacker
Copy link
Contributor Author

Ah, you'll need to float the version number out into the let expression too and inherit it. I think I'm okay with that.

I do not see how this improves anything, why do you think this is cleaner?

@offlinehacker
Copy link
Contributor Author

I would like to keep things cleaner without using let expression, as I do not see benefits here. I do not think we have guidelines about that, so I am not against it, just do not see benefits.

@roconnor
Copy link
Contributor

Download isn't controlled by lazy evaluation. You had to explicitly mark some parts as optional withGui and other parts as not.

Very generally speaking, the more we are explicit about this sort of thing, the more likely it is to cause problems in future revisions when things change and we end up unnecessarily downloading objects for build configurations that do not need them. If we make things implicit than the downloads will exactly occur when the expressions ${desktop} and ${pixmap} end up in the derivation structure's value.

However you strongly prefer things the way you've written them, I won't object any further.

@offlinehacker
Copy link
Contributor Author

Ok, after reviewing again I agree with suggested changes, as it removes unnecessary optional expression, and also putting version into let removes unnecessary rec. Less code means less room for error, so I will do that, thanks.

@offlinehacker
Copy link
Contributor Author

should be good now

@roconnor
Copy link
Contributor

Were you planning on eliminating the rec?

@offlinehacker
Copy link
Contributor Author

I couldn't since conditional with doCheck uses it here:

] ++ optionals (!doCheck) [
Since it's no-op I can remove it or refactor in let block, but just keeping rec was easiest, what do you prefer?

@roconnor
Copy link
Contributor

I see. I'm good either way, but if you do choose to abstract the doCheck then move to a top-level function argument with a default value of true.

@Lassulus
Copy link
Member

whupsie, sorry for closing to early, say when this is ready for merge

@roconnor
Copy link
Contributor

I don't know what the correct -m permissions ought to be, but 644 seems like a fairly commonly used value. Looks good to me. @prusnak or @jb55 did you want to re-review?

Copy link
Contributor

@jb55 jb55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roconnor roconnor merged commit 6a75080 into NixOS:master Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants