bitcoin: add support for altcoins, add litecoin, namecoin and dogecoin, add nixos module#1375
Conversation
|
Maybe we should split those into separate packages, or is there a reason to keep them in the same file? |
|
Well, there's almost no difference betwene these packages(they are just
|
|
Btw namecoin does not build yet, but that's not that important.
|
|
Maybe it's a good idea to leave bitcoin in Also, there's still some unnecessary duplication in the code for headless & non-headless builds |
|
I will think about that.
|
|
Thanks for getting this started. namecoin wouldn't compile; I fixed it in falsifian/nixpkgs@90a6c3c , so please consider adding that to the pull request. (I only compiled it; I didn't try running it.) I started to implement @the-kenny's suggestion about putting litecoin in litecoin.nix etc, but it quickly got ugly, because I wanted to pass a lot of arguments to many import commands. Maybe there is a nice way that I do not know about. Why not follow @offlinehacker's method for now, and if a particular altcoin diverges too much from bitcoin, just give it a fresh file that doesn't reference the main one? The expressions are simple enough. |
|
BTW, it would be nice if the headless and GUI versions had different package names, to make it easier to choose one with nix-env -i. |
|
Well yes, if somebody wants to add a lot of altcoins it gets ugly. I
|
|
I'm not familiar with how Ruby does it, but the generic python builder in development/python-modules/generic could be a model (hopefully much much simpler in this case). So I guess the two leading options are to do something like Ruby or Python, or to just let there be some duplicated code? |
|
I added peercoin; see falsifian/nixpkgs@b939017 . It works as far as I can tell, though I haven't sent or received any. |
|
@the-kenny @falsifian Any idea how to remove unnecessary duplication in the code for headless & non-headless builds? |
|
How about having a configuration variable "bitcoin.gui"? Then configurePhase could be (if gui then "qmake" else ""), and so on. I can take a look at it if you like, but maybe not today. A side note: don't both versions build bitcoind? I think bitcoind should be installed even when you choose the gui version. |
|
Er, I guess instead of configuration var I meant "option", in the same style as git.guiSupport. |
|
Okay, I did some re-organization. See my pkgs/bitcoin/altcoin_support branch at https://github.com/falsifian/nixpkgs/tree/pkgs/bitcoin/altcoin_support For example, nix-build -A bitcoin.headless or nix-build -A bitcoin.gui. I haven't really tested anything except very briefly ppcoin.headless. Here's what I did: I made a file called build_bitcoin.nix that contains the generic code for building both a headless and a gui version. I tried to avoid duplicating code, but to be honest I'd rather go back to having two separate expressions (headless and gui) like offlinehacker's original commit, since the build instructions seem to be completely different. I noticed that building the gui doesn't cause the headless version to be build, so I opted to make *coin.headless options -- instead, the bitcoin builder expression produces two separate derivations. See my example nix-build commands above. |
|
Each coin is now in a separate .nix file. |
|
And I just successfully ran ppcoin-qt (built with nix-build -A ppcoin.gui) so it's reasonably possible that everything just works at this point. |
Each cryptocurrency in a separate file, and less duplication of code between the headless and gui expressions.
|
@offlinehacker , do you like my re-organization? If so, please merge my branch (same name as your branch; repo is git@github.com:falsifian/nixpkgs.git ) or I can just open a new pull request if it's simpler. |
|
I like the way how you merge headless and non-headles, but i don't like
|
|
@offlinehacker I don't really think that would be a huge problem as long as they don't conflict with other packages, and there are really only a few crypto-currencies that actually has user bases of decent sizes (bitcoin, litecoin, namecoin, peercoin and well, dogecoin) now. |
|
@offlinehacker, I'd personally prefer to keep build_bitcoin separate (give it its own file and list it in all-packages.nix) but besides that I'm indifferent on both issues. My reason: if build_bitcoin is not separated, it might be hard to separate it in the future. So if people start adding lots of altcoins (not that unlikely) it will be hard to untangle the mess in the future. By the way, I noticed freicoin is already merged to master. Let's get this moving :-) |
|
I don't really see the problem, look in python-packages.nix, or in
|
|
You can of course keep builder function in separate file, but i think coins
|
|
Good point; it does seem to work well in existing cases. Now I am not so attached to separate files. I put all the coins in one file and removed all the individual coins except bitcoin from all-packages.nix. I also renamed the directory to bitcoin_etc. Maybe a better name is possible. |
|
Humm one idea would be to have cryptocurrencies folder and put there all On Tue, Feb 11, 2014 at 5:58 AM, James Cook notifications@github.comwrote:
|
|
I'm happy with pretty much anything. Not sure when I'll have time to work on it though, so feel free to fiddle with it, with or without merging my changes. BTW I don't have any sort of power to merge pull requests. |
|
Yeah i don't have merging-power too, will take your changes and try to make the sane version of all ideas we discussed. |
|
I also have nixos module(with support for multiple coins running at the same time) ready to push after this gets merged. |
|
Thanks! |
|
@falsifian @offlinehacker this is ready to be reviewed? |
|
@iElectric, not yet, still waiting somewhere in low priority queue, will
|
|
@offlinehacker Still in your queue? |
|
Yep :) also working on cryptocoin2nix that would auto generate packages for
|
|
@offlinehacker i see multiple things you've changed here. if you can, can you split this pull request in multiple? if you dont have time i'll cherry pick into master. but i would need at least that your branch is rebased on current master. |
|
Ah yes, i forgot to remove a few commits, it should be fine now :) |
|
I think this could be merged now :) |
|
Ahh dammn, after trying to update to latest version i just realized installation process of bitcoin changed, so now we have incossistency, i will just split into multiple files as was originally suggested and stop complicating. |
|
@offlinehacker - Can we close this pull request then? Thanks for your work on *coin! |
|
+1 for having a cryptocurrency folder, both for packages and for services. |
|
Okay i added support for building new version of bitcoin packages, this should be ready for merging. |
3a18ac5 to
212d91a
Compare
|
I've fixed this. Now bitcoin is separate expression and altcoins are separate expression, i have removed nixos module, it builds fine, i'm merging. |
bitcoin: add support for altcoins, add litecoin, namecoin and dogecoin
No description provided.