Re: [Nix-dev] Build Android apps with the Nix package manager
Dear Sander, thank you so very much for this! Regards, Alexander Foremny 2012/11/7 Rickard Nilsson rickard.nils...@telia.com Den 2012-11-07 21:16:56 skrev Sander van der Burg - EWI s.vanderb...@tudelft.nl: Hi everybody, I have been quiet for some time. At my new employer I have spent some time in developing an infrastructure as well as 2 functions capable of building and emulating Android Apps (http:/www.android.com). I have a detailed blog post about this here: http://sandervanderburg.blogspot.com/2012/11/building-android-applications-with-nix.html Feedback, suggestions, compliments etc. are welcome! Great stuff! I will try this out. Thanks for all your hard work! Best regards Rickard Nilsson ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Packaging Bash Scripts
Glad that someone is interested in this package. There is a Nixpkgs branch [1] available until the pull request gets accepted. Shea, thanks again for your help! Regards, Alexander Foremny [1] https://github.com/aforemny/nixpkgs/tree/plowshare 2012/8/30 Sergey Mironov ier...@gmail.com: Thanks a lot, I missed this helpful package. 2012/8/30 Alexander Foremny alexanderfore...@gmail.com: Dear Shea, thank you very much. Everything works as expected now. Regards, Alexander Foremny PS. Forwarding to the list. Shea, sorry for the noise. 2012/8/30 Shea Levy s...@shealevy.com: On 08/29/2012 09:20 AM, Alexander Foremny wrote: Hello Shea, thank you very much for your response! I modified my Nix expression [1]. Is this correct? It looks like you forget to specify what to set $PATH to, I think you need to specify ${curl}/bin or some such Is there a way to test if things are actually working? Apparently I cannot remove curl from my profile. If you check the resultant binary (it will be a shell script if created with wrapProgram), you should see $PATH getting set (or augmented) with the relevant path. $ nix-env -e curl $ curl --help Usage: curl [options...]url ... The commands above prints curl's help text which I did not expect. Regards, Alexander Foremny [1] https://github.com/aforemny/nixpkgs/blob/aed5c366944b98624411c5551f2d43becafdf44d/pkgs/tools/misc/plowshare/default.nix 2012/8/29 Shea Levys...@shealevy.com: Hi Alexander, On 08/29/2012 05:27 AM, Alexander Foremny wrote: Hello list, I am currently trying to create a Nix expression for plowshare [1]. I got a working version [2] already, since installation is quite straight forward. However, as mentioned in the pull request I am worrying about purity. In particular the Bash script calls the curl binary. The first observation is that running one of plowshare's executables the curl binary is being found correctly. I think this is because curl is available in my PATH. $ which curl ~/.nix-profile/bin/curl I would have expected that this wouldn't be the case if I had removed curl from my environment. However, the following still yields the same result. $ nix-env -e curl $ which curl ~/.nix-profile/bin/curl This also arises in a newly created shell and I can also execute the curl binary. I am guessing that curl is some kind of NixOS' standard environment. Is this correct? Is it considered an impurity that plowshare finds curl without depending on curl's derivation? If this is the case, is this impurity introduced by NixOS or by the Nix expression? It's an impurity in plowshare's nix expression. If this is an issue, how would I solve it? Should I patch plowshare's Bash scripts to refer to the curl's derivation instead of `which curl`? Or even better, is there a wrapper for this kind of programs already? wrapProgram (available if you add makeWrapper to buildInputs) is probably what you want. An example of how it can be used is at https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/taxes/aangifte-2011/default.nix#L30 Regards, Alexander Foremny [1] http://code.google.com/p/plowshare/ [2] https://github.com/NixOS/nixpkgs/pull/117 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] NixOS for Raspberry Pi?
Hello, I'd be very interested in this as well and could probably spare some time for this. Has there been any progress yet? Regards, Alexander Foremny 2012/6/11 Lluís Batlle i Rossell vi...@viric.name: On Mon, Jun 11, 2012 at 02:53:53PM +0200, Rickard Nilsson wrote: Hi, Is anyone working on getting NixOS running on the Raspberry Pi (ARM-based, http://www.raspberrypi.org/)? If so, I'm happy to help out. If not, I will try to start working on it soon. Hopefully, the fact that I have NixOS running on my SheevaPlug (also ARM) will make it easier to get it to run on my Pi. I always thought the 256MiB of RAM would make it a bit difficult to use well enuogh. And for a benchmark I've seen, I imagine it will run a bit slower than the sheevaplug. If you need any help, we can talk either by irc or this list. Good luck! ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] Cross Compiling for Raspberry PI
Hello, I am currently trying to cross compile some packages for the Raspberry PI. In my private Nixpkgs repository I created the file raspberrypi.nix. The relevant parts of that file follow. import ./default.nix { crossSystem = { platform = { kernelBaseConfig = bcmrpi_defconfig; kernelHeadersBaseConfig = bcmrpi_defconfig; }; config.packageOverrides = pkgs: { linux_3_5 = pkgs.linux_3_5.override { kernelPatches = [ pkgs.kernelPatches.raspberrypi_defconfig ]; }; }; } I created a raspberry_defconfig patch which adds the file bcmrpi_defconfig to the Linux kernel's source tree. Now I'd like to try building kernel-headers for the Raspberry PI, thus I ran. $ nix-build -A linux_3_5.hostDrv raspberrypi.nix --dry-run these derivations will be built: /nix/store/31vqzwfyqw52y0s1jy57i1fwx9clcjfh-gcc-4.6.3-arm-unknown-linux-stage-static.drv ... /nix/store/pxlbdi3sxfisi7z0q9pxgbavjhy2k49v-linux-headers-3.5.drv Actually building it starts with building gcc-4.6.3-arm-unknown-linux-stage-static, but fails with the error, that the file bcmrpi_defconfig is not present. ... *** *** Can't find default configuration arch/arm/configs/bcmrpi_defconfig! *** make[1]: *** [bcmrpi_defconfig] Error 1 checking for arm-unknown-linux-nm... make: *** [bcmrpi_defconfig] Error 2 builder for `/nix/store/pxlbdi3sxfisi7z0q9pxgbavjhy2k49v-linux-headers-3.5.drv' failed with exit code 2 I am guessing that gcc needs the kernel headers and since crossSystem.platform.kernelHeadersBaseConfig is set to bcmrpi_defconfig, gcc needs this file. Is this correct? Would it be a solution, to use a different kernelHeadersBaseConfig setting? Would it be a solution, to patch gcc's Nix expression? Regards, Alexander Foremny ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] Using Nix for installing local projects
Hello list, today I ran into a problem which I don't know how to solve. I needed the Haskell library hoauth [1] which was not available in Nixpkgs. Using cabal2nix and my local Nixpkgs repository creating a Nix expression and installing it via $ nix-env -f ~/code/nixpkgs/default.nix -i haskell-hoauth-ghc7.4.1 was no problem. However, I realized I need to perform some modifications to the hoauth package. So I grabbed the source from hoauth and modified it according to my needs. Now I need to install this modified version in order to test the changes. I'd like to use Nix instead of cabal to keep my system clean. However, placing those changes into ~/code/nixpkgs is cumbersome because I don't want to distribute those changes just yet. Of course I could create a diff and apply this in ~/code/nixpkgs, but it would be much easier if I could just create a Nix expression within the modified hoauth directory and somehow tell Nix to install this. Is this possible? How do you handle such cases? Another option would be to specify a file path as src in cabal.mkDerivation. Is this possible? Regards, Alexander Foremny [1] http://hackage.haskell.org/package/hoauth ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Using Nix for installing local projects
Thanks for the detailed information! However, it appears as if the simplest approach to this is not possible in NixOS, just installing a local Nix expression. Is there a grave reason for this? I am creating an executable which directly depends on hoauth and hoauth isn't required by any other package I have installed. However, this is quite a special case and a more general setting should be taken into account of course for a solution. So I can agree with library hoauth library' executable. Regarding 1) Thanks! I didn't know about sdist. This might be of help but isn't really what I want since I don't want to publish the sources (or have them sitting around on my system somewhere). However, since sdist really isn't that much of work it might be an option. Regarding 2) I don't know much about overrides. Waiting for an additional response then. Regarding 3) I am somehow reluctant to differ to much from official NixOS. I cannot really tell why. Probably because Nixpkgs works for me in so many situations and I'd like it better if corner cases such as this could be handled by the vanilla distribution. Regards, Alexander Foremny PS. I accidentally responded to Marc's message directly. Here's a copy to the list and to Marc: sorry for the noise. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Using Nix for installing local projects
Thank you. Those suggestions are helpful too, albeit they are quite hacky. Especially since you cannot force a rebuild of an unchanged Nix expression, but I suppose this is by design. Regards, Alexander Foremny 2012/6/27 Peter Simons sim...@cryp.to: The following message is a courtesy copy of an article that has been posted to gmane.linux.distributions.nixos as well. Hi Alexander, Another option would be to specify a file path as src in cabal.mkDerivation. Is this possible? you could define unpackPhase to be something along the lines of: rsync -a /home/yours/src/hoauth . This would make Nix build whatever you have in your working copy. It's not exactly a clean solution, but it would work. The alternative I tend to use is to define: src = fetchgit { url = /home/yours/src/hoauth; rev = 1cd915d689ec19d0348e1b30e1ba4c4c7dc97d8b; }; This means that I have to put my working copy under version control, but I actually like that, so it's okay for me. In any case, you'll find yourself editing the Nix expression every time you want to run a build, though, because Nix won't re-build unless something has changed. In my case, I set the rev field to the current HEAD of the repository. In the unpackPhase solution from above, you'd probably have to bump some version field to trigger a re-build. Generally speaking, I feel that Nix is just moderately useful for running local development builds. In the case of Haskell, you may find that tools like cabal-dev turn out to be easier to use in the end. Take care, Peter ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] Python bindings to librsvg or gnome-desktop
Hello, I am trying to create a Nix expression for solfege [1] and got it building fine using the Nix expression available as Gist [2]. However, running the application fails with the following error, cryptographic hashes replaced by dots. Traceback (most recent call last): File /nix/store/...-solfege-3.20.4/share/solfege/solfege/startup.py, line 159, in start_gui solfege.win = w = MainWin(options, datadir) File /nix/store/...-solfege-3.20.4/share/solfege/solfege/mainwin.py, line 119, in __init__ stock.SolfegeIconFactory(self, datadir) File /nix/store/...-solfege-3.20.4/share/solfege/solfege/stock.py, line 71, in __init__ self.add_icons(d) File /nix/store/...-solfege-3.20.4/share/solfege/solfege/stock.py, line 33, in add_icons iconset = gtk.IconSet(gtk.gdk.pixbuf_new_from_file(os.path.join(self.datadir, filename))) glib.GError: Couldn't recognize the image file format for file '/nix/store/..-solfege-3.20.4/share/solfege/graphics/solfege.svg' This issue has been addressed [3] and appears to be an issue not caused by solfege but by a missing python dependency [4]. It is solved by making solfege depend on python-rsvg. However, I cannot find this package in Nixpkgs. Further research revealed that this binding is now part of the Python bindings to Gnome [5]. As observable in the current NIx expression I added the dependency gnome_python hoping this would solve the problem. However, it does not. Is it correct that gnome_python are the Python bindings to Gnome Desktop which should contain pyrsvg? If not, is pyrsvg already packaged? If not, where can I find the sources of python-gnome-desktop and where would be a good place to place a Nix expression for this? Or could it be the case that this functionality should be supplied by pygtk, but this (optional?) feature is disabled due to missing dependencies? Since I am already at it, why are some packages referenced by pythonPackages.{package} and some solely by {package}? For instance, the python sqlite3 module appears to be pythonPackages.sqlite3 whereas python bindings to GTK+ are not available as pythonPackages.gtk or pythonPackages.pygtk but as pygtk. When creating a Nix expression that depends on python packages, Is it more desirable to depend on pythonPackages or the inherit the pythonPackages.* subpackages as necessary? Regards, Alexander Foremny [1] http://solfege.org [2] https://gist.github.com/2953069 [3] http://code.google.com/p/solfege/issues/detail?id=255 [4] https://bugs.launchpad.net/ubuntu/+source/solfege/+bug/1004485 [5] http://www.rittau.org/blog/20060418-00 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Python bindings to librsvg or gnome-desktop
Thanks for your quick response. Could you please give me the reference for [1]? I don't know how I can force building a package. 2012/6/19 Marc Weber marco-owe...@gmx.de: gnome support is only rudimentary (enough to make some packages work). Look at configure output of pygtk etc (force a rebuild [1] and do nix-store -l $out-path) If you start working on python stuff please be aware that I feel that the current PYTHONPATH implementation in nixpkgs is not enough. Some packages such as virtinst would require heavy patching - others do not. For that reason I've tried an alternative implementation introducing NIX_PYTHON_SITES: https://github.com/MarcWeber/nixpkgs/blob/experimental/nix-python-sites/.topmsg But this might be totally unrelated to your issues. When creating a Nix expression that depends on python packages, Is it more desirable to depend on pythonPackages or the inherit the pythonPackages.* subpackages as necessary? I don't know. I personally tried packaging everything found on PyPi - but that index is not that well maintained - a lot of libraries are missing. So for now I expect a lot of manual work to be done on python packages. The common case seems to be that packages which have lot's of C dependencies (such as gtk) are more likely to be put into top-level files. Whether this is desired behaviour - I don't know exactly. If you publish your patches I may have a look at it. That's my personal view on it. Marc Weber ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] lighttpd service
Thanks for your response. The lighttpd branch [1] is now on GitHub. But it isn't anything special. I'll try for a more sophisticated Nix expression the next few days. [1] https://github.com/aforemny/nixos/tree/lighttpd 2012/6/7 Kirill Elagin kirela...@gmail.com: I think the right way to handle config files is the on used by xserver module. You provide a basic config, enough to run lighty in most well-trodden configurations, similar to configs included by other distros. And when someone needs an advanced config he just overwrites it completely with mkOverride. -- Кирилл Елагин 2012/6/7 Alexander Foremny alexanderfore...@googlemail.com Thanks for the notification. I rebased my Git repositories after I wrote the last mail and apparently forgot to push my local branch. It is working, but support through options in configuration.nix is very basic. I'll gladly maintain a more sophisticated Nix expression but I don't know how (and if) this is possible. I'll try for tomorrow to push my local branches to GitHub. ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] lighttpd service
Thanks for the notification. I rebased my Git repositories after I wrote the last mail and apparently forgot to push my local branch. It is working, but support through options in configuration.nix is very basic. I'll gladly maintain a more sophisticated Nix expression but I don't know how (and if) this is possible. I'll try for tomorrow to push my local branches to GitHub. 2012/6/7 Kirill Elagin kirela...@gmail.com: Hi! So, what is the fate of your work? I'm also interested in lighttpd service but can't see anything in your github repo. -- Кирилл Елагин 2012/6/2 Alexander Foremny alexanderfore...@googlemail.com Hello, with Rickard's help I created a very simple Nix expression for Lighttpd. The changes can be found in my Git repository [1]. I've had some trouble with fetching upstream/master and merging it. But I think everything is in order now except some bogus commit messages. I'd appreciate comments on the Nix expression and wanted to ask if this could be merged into upstream. Should I file a pull request as soon as this patch is agreed upon? I don't quite know how to progress further from here. Lighttpd's configuration appears to be really complex due to conditionals [2] and as far as I can tell it wouldn't make sense to model this as configuration options. However, would you like to see (limited) virtual host support in the Nix expression? Some first ideas are in the lighttpd branch [3]. Regards, Alexander Foremny [1] https://github.com/aforemny/nixos/tree/lighttpd-simple [2] http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:Configuration [3] https://github.com/aforemny/nixos/tree/lighttpd 2012/6/2 Alexander Foremny alexanderfore...@googlemail.com: Great! This is working for me, too. Thank you very much. 2012/5/31 Rickard Nilsson rickard.nils...@telia.com: Hi Alexander, I have no troubles running av minimal lighttpd on NixOS. I can start and stop it with upstart. My configuration looks like this: let root = /srv/www; httpPort = 3000; httpConf = writeText webserver.conf '' server.document-root = ${root} server.port = ${httpPort} ''; in { jobs.webserver = { path = [ lighttpd ]; exec = lighttpd -D -f ${httpConf}; }; } Regards, Rickard Nilsson Den 2012-05-27 16:03:50 skrev Alexander Foremny alexanderfore...@googlemail.com: Hello, I am still trying to get a minimal Nix expression for Lighttpd to work. However, I cannot get the upstart job to behave well. The Nix expression for the service so far is available on GitHub [1]. I also uploaded the generated upstart job file [2]. What's strange is that starting / stopping the upstart job seems to hang forever. For instance # initctl status lighttpd lighttpd stop/waiting # initctl start lighttpd [ here it hangs forever ] In another terminal I can see that Lighttpd in fact is successfully started by upstart. # initctl status lighttpd lighttpd start/spawned, process 4803 ps reports that the PID inferred by upstart is correct. I then Ctrl-C out of the hanging initctl start lighttpd. However, trying to initctl stop the lighttpd job it hangs again without any output. A strace gives the following last lines. # strace initctl stop lighttpd recvmsg(3, 0xbffe2b9c, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable) clock_gettime(CLOCK_MONOTONIC, {1782, 252572560}) = 0 poll([{fd=3, events=POLLIN}], 1, -1 However, this time the Lighttpd server process is not being terminated by upstart! I tried increasing upstart's log verbosity without gaining any additional insight. Does anyone of you have an idea of what's going on? Any help would greatly be appreciated. Regards, Alexander Foremny [1] https://github.com/aforemny/nixos/blob/master/modules/services/web-servers/lighttpd/default.nix [2] https://gist.github.com/2814308 2012/5/24 Nicolas Pierron nicolas.b.pier...@gmail.com: Hi, On Tue, May 22, 2012 at 3:13 PM, Alexander Foremny alexanderfore...@googlemail.com wrote: I am trying to write a service module for lighttpd. I came up with a minimal example [1] which is giving me the following error upon rebuilding my system. Nice. I would be happy to see that. How can I make my option services.lighttpd known to NixOS? Every NixOS file, even your configuration.nix is a module, this means that you don't have to build against a custom version of NixOS unless you want to modify some of its files. If you just want to *add* a new module, I will recommend you to use the require or imports attribute in your configuration.nix. So your /etc/nixos/configuration.nix should look like: { require = [ lighttpd/default.nix ]; … } The syntax of module is documented in the wiki[1] for more detail. [1] http://nixos.org/wiki/NixOS:Modules -- Nicolas Pierron http
Re: [Nix-dev] lighttpd service
Hello, with Rickard's help I created a very simple Nix expression for Lighttpd. The changes can be found in my Git repository [1]. I've had some trouble with fetching upstream/master and merging it. But I think everything is in order now except some bogus commit messages. I'd appreciate comments on the Nix expression and wanted to ask if this could be merged into upstream. Should I file a pull request as soon as this patch is agreed upon? I don't quite know how to progress further from here. Lighttpd's configuration appears to be really complex due to conditionals [2] and as far as I can tell it wouldn't make sense to model this as configuration options. However, would you like to see (limited) virtual host support in the Nix expression? Some first ideas are in the lighttpd branch [3]. Regards, Alexander Foremny [1] https://github.com/aforemny/nixos/tree/lighttpd-simple [2] http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:Configuration [3] https://github.com/aforemny/nixos/tree/lighttpd 2012/6/2 Alexander Foremny alexanderfore...@googlemail.com: Great! This is working for me, too. Thank you very much. 2012/5/31 Rickard Nilsson rickard.nils...@telia.com: Hi Alexander, I have no troubles running av minimal lighttpd on NixOS. I can start and stop it with upstart. My configuration looks like this: let root = /srv/www; httpPort = 3000; httpConf = writeText webserver.conf '' server.document-root = ${root} server.port = ${httpPort} ''; in { jobs.webserver = { path = [ lighttpd ]; exec = lighttpd -D -f ${httpConf}; }; } Regards, Rickard Nilsson Den 2012-05-27 16:03:50 skrev Alexander Foremny alexanderfore...@googlemail.com: Hello, I am still trying to get a minimal Nix expression for Lighttpd to work. However, I cannot get the upstart job to behave well. The Nix expression for the service so far is available on GitHub [1]. I also uploaded the generated upstart job file [2]. What's strange is that starting / stopping the upstart job seems to hang forever. For instance # initctl status lighttpd lighttpd stop/waiting # initctl start lighttpd [ here it hangs forever ] In another terminal I can see that Lighttpd in fact is successfully started by upstart. # initctl status lighttpd lighttpd start/spawned, process 4803 ps reports that the PID inferred by upstart is correct. I then Ctrl-C out of the hanging initctl start lighttpd. However, trying to initctl stop the lighttpd job it hangs again without any output. A strace gives the following last lines. # strace initctl stop lighttpd recvmsg(3, 0xbffe2b9c, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable) clock_gettime(CLOCK_MONOTONIC, {1782, 252572560}) = 0 poll([{fd=3, events=POLLIN}], 1, -1 However, this time the Lighttpd server process is not being terminated by upstart! I tried increasing upstart's log verbosity without gaining any additional insight. Does anyone of you have an idea of what's going on? Any help would greatly be appreciated. Regards, Alexander Foremny [1] https://github.com/aforemny/nixos/blob/master/modules/services/web-servers/lighttpd/default.nix [2] https://gist.github.com/2814308 2012/5/24 Nicolas Pierron nicolas.b.pier...@gmail.com: Hi, On Tue, May 22, 2012 at 3:13 PM, Alexander Foremny alexanderfore...@googlemail.com wrote: I am trying to write a service module for lighttpd. I came up with a minimal example [1] which is giving me the following error upon rebuilding my system. Nice. I would be happy to see that. How can I make my option services.lighttpd known to NixOS? Every NixOS file, even your configuration.nix is a module, this means that you don't have to build against a custom version of NixOS unless you want to modify some of its files. If you just want to *add* a new module, I will recommend you to use the require or imports attribute in your configuration.nix. So your /etc/nixos/configuration.nix should look like: { require = [ lighttpd/default.nix ]; … } The syntax of module is documented in the wiki[1] for more detail. [1] http://nixos.org/wiki/NixOS:Modules -- Nicolas Pierron http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] lighttpd service
Hello, I am still trying to get a minimal Nix expression for Lighttpd to work. However, I cannot get the upstart job to behave well. The Nix expression for the service so far is available on GitHub [1]. I also uploaded the generated upstart job file [2]. What's strange is that starting / stopping the upstart job seems to hang forever. For instance # initctl status lighttpd lighttpd stop/waiting # initctl start lighttpd [ here it hangs forever ] In another terminal I can see that Lighttpd in fact is successfully started by upstart. # initctl status lighttpd lighttpd start/spawned, process 4803 ps reports that the PID inferred by upstart is correct. I then Ctrl-C out of the hanging initctl start lighttpd. However, trying to initctl stop the lighttpd job it hangs again without any output. A strace gives the following last lines. # strace initctl stop lighttpd recvmsg(3, 0xbffe2b9c, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable) clock_gettime(CLOCK_MONOTONIC, {1782, 252572560}) = 0 poll([{fd=3, events=POLLIN}], 1, -1 However, this time the Lighttpd server process is not being terminated by upstart! I tried increasing upstart's log verbosity without gaining any additional insight. Does anyone of you have an idea of what's going on? Any help would greatly be appreciated. Regards, Alexander Foremny [1] https://github.com/aforemny/nixos/blob/master/modules/services/web-servers/lighttpd/default.nix [2] https://gist.github.com/2814308 2012/5/24 Nicolas Pierron nicolas.b.pier...@gmail.com: Hi, On Tue, May 22, 2012 at 3:13 PM, Alexander Foremny alexanderfore...@googlemail.com wrote: I am trying to write a service module for lighttpd. I came up with a minimal example [1] which is giving me the following error upon rebuilding my system. Nice. I would be happy to see that. How can I make my option services.lighttpd known to NixOS? Every NixOS file, even your configuration.nix is a module, this means that you don't have to build against a custom version of NixOS unless you want to modify some of its files. If you just want to *add* a new module, I will recommend you to use the require or imports attribute in your configuration.nix. So your /etc/nixos/configuration.nix should look like: { require = [ lighttpd/default.nix ]; … } The syntax of module is documented in the wiki[1] for more detail. [1] http://nixos.org/wiki/NixOS:Modules -- Nicolas Pierron http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/ ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] nixos-rebuild and NIX_PATH
Hallo, after upgrading nix to version 1.0 I am trying to build my system configuration from my custom nixos and nixpkgs repository. I run into problems after I deleted /etc/nixos/{nixpkgs,nixos} as if I am not mistaken they are not needed anymore. However, simply running nixos-rebuild fails. $ nixos-rebuild build error: file `nixos' was not found in the Nix search path (add it using $NIX_PATH or -I) error: file `nixos' was not found in the Nix search path (add it using $NIX_PATH or -I) error: file `nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I) Inspecting NIX_PATH this is understandable. $ echo $NIX_PATH /nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs:nixos=/etc/nixos/nixos:nixos-config=/etc/nixos/configuration.nix:services=/etc/nixos/services nixpkgs and nixos are still referenced there. Why is that? Should I remove those references from NIX_PATH? Where would be a good place to do that? This should probably apply system-wide. However, removing those references I still get the same errors. $ echo $NIX_PATH /nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix $ nixos-rebuild build building Nix... error: file `nixos' was not found in the Nix search path (add it using $NIX_PATH or -I) error: file `nixos' was not found in the Nix search path (add it using $NIX_PATH or -I) error: file `nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I) Okay then, maybe I should use the -I option to include my custom nixos and nixpkgs repositories which are cloned from GitHub. All of the following commands give the same errors as above (with NIX_PATH is cleared from the invalid references). $ nixos-rebuild -I ~/code/nixos:~/code/nixpkgs build $ nixos-rebuild -I ~/code/nixos -I ~/code/nixpkgs build $ nixos-rebuild -I nixos=~/code/nixos:nixpkgs=~/code/nixpkgs build $ nixos-rebuild -I nixos=~/code/nixos -I nixpkgs=~/code/nixpkgs build What am I doing wrong? Is it a misunderstanding that I could have safely removed /etc/nixos/{nixos,nixpkgs}? Any help would be greatly appreciated. Regards, Alexander Foremny ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] lighttpd service
Hello, I am trying to write a service module for lighttpd. I came up with a minimal example [1] which is giving me the following error upon rebuilding my system. $ nixos-rebuild -I nixos=~/code/nixos build Option 'services.lighttpd' defined without option declaration. I added the following line to nixos/modules/module-list.nix and my Nix expression given in [1] is located at nixos/services/web-servers/lighttpd/default.nix. ./services/web-servers/lighttpd/default.nix How can I make my option services.lighttpd known to NixOS? Regards, Alexander Foremny [1] https://gist.github.com/2771986 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] NixOS Xen guest and blkfront
Hello, I managed to install NixOS on a Rackspace Cloud Server [1]. In particular, in configuration.nix I am using the following configuration parts. require = [ ${modulesPath}/virtualisation/xen-domU.nix ]; fileSystems = [ { mountPoint = /; device = /dev/xvda1; } ]; When trying to exit Rescue Mode and booting into the NixOS system I get the following (for this problem relevant) messages during boot: NixOS Stage 1 loading module xen-blkfront blkfront: xvda: barrier enabled blkfront: xvdc: barrier enabled mounting /dev/xvda1 on /... NixOS Stage 2 running activation script... setting up /etc... updating groups... updating users... blkfront: barrier: empty write xvda op failed blkfront: xvda: barrier or flush: disabled end_request: I/O error, dev xvda, sector 9443896 end_request: I/O error, dev xvda, sector 9443896 Buffer I/O error on device xvda1, logical block 1180341 lost page write due to I/O error on xvda1 Aborting journal on device xvda1 EXT-3-fs (xvda1): error: ext3_journal_start_sb: Detected aborted journal EXT-3-fs (xvda1): error: remounting filesystem read-only Then / remains mounted in read-only mode and thus NixOS cannot start up any services. This is an error that seems to be known [2]. There it is suggested to mount the root partition with barrier=0 option. I edited /boot/grub/menu.lst and appended the following option to the kernel line. rootflags=barrier=0 Also, I changed my configuration.nix to include the following line, just to be sure and to possibly drop the manual change from /boot/grub/menu.lst. fileSystems = [ { mountPoint = /; device = /dev/xvda1; options = barrier=0; } ]; I can correctly see the barrier=0 option in /etc/fstab. However, the problem persists as described above. Also, during boot before NixOS Stage 1 kicks in I can see the following line, which I believe comes from the changed menu.lst. Command line: systemConfig=/nix/store/xy19d9bs1bzgbqc31nq0j0xkxy00sngy-nixos-0.1pre34086-34079 init=/nix/store/xy19d9bs1bzgbqc31nq0j0xkxy00sngy-nixos-0.1pre34086-34079/init rootflags=barrier=0 Does anyone have any suggestions what I can try to resolve this? [1] http://nixos.org/wiki/Install_NixOS_on_Rackspace_Cloud_Servers [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637234 ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Bootstrapping NixOS
Unfortunately it appears as if Rackspace doesn't offer i686 Linux distributions to be run on their Cloud Servers. So I couldn't use the fixed i686 bootstrapping archive. I managed to install NixOS on a Rackspace Cloud Server running Gentoo. I documented the process of installation on the wiki in case anyone is interested in it. However, it is definitely not ideal to install NixOS this way. But it works for now. https://nixos.org/wiki/Install_NixOS_on_Rackspace_Cloud_Servers Regards Alexander Foremny 2012/5/10 Marc Weber marco-owe...@gmx.de: Maybe I should just remove the wiki until I find time to host current bootstrapping archives myself. I personally think the community should provide more feedback to get this back into the repositories.. Eelco Dolstra removed it in the bast due to lack of documentation without even asking for improving it. If you have a fast connection bootstrap on your own qemu instance and copy everything up to your server eg using rsync or by creating your own tar. I can also create a new archive for you. i686 is no issue. x86_64 will require longer upload time ( a couple of hours ). http://mawercer.de/~marc/minimal-install-archive.patch is the last patch which still may apply which you can use to create the archive yourself. cd /etc/nixos/nixos; nix-build -A minimal_install_archive ./release.nix If others have a better way for bootstrapping they may talk about their way. Nice about my archive is that it ships with scripts such as run-in-chroot which you may want to use a couple of times for rebuilding the system till you get everything right. Marc Weber ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] [PATCH] Vimprobable2 1.0.0
Hello, attached is a patch for Vimprobable2. I updated the Nix expression to version 1.0.0 of the browser. Besides that there are only minor changes to the expression. I'd be happy if this patch could be applied. Regards Alexander Foremny vimprobable2-1.0.0.diff Description: Binary data ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] Vim script: haskell-mode
Hello, I am trying to package the vim script haskell-mode [1] for NixOS. The revelevant part of my Nix expression is the following phases = [ installPhase ]; buildInputs = [ vim ]; installPhase = '' VIMDIR=$(ls ${vim}/share/vim) ensureDir share/vim/$VIMDIR cd share/vim/$VIMDIR vim -c so % | qa $src ''; Notice that $src points to the vimball file which is downloaded by fetchurl. However, I get the following error upon installation of the Nix expression via nix-env. E492: Not an editor command: UseVimball It appears as if the plugin vimballPackage.vim is not loaded. However, running the above vim command with the -V flag gives: ... sourcing /nix/store/wcwi8vc1y5126wdcbynxg0lxzmrj3vqa-vim-7.3/share/vim/vim73/p ugin/vimballPlugin.vim finished sourcing /nix/store/wcwi8vc1y5126wdcbynxg0lxzmrj3vqa-vim-7.3/share/vim vim73/plugin/vimballPlugin.vim ... which appears to be right. What am I doing wrong with this approach? Regards Alexander Foremny [1] http://projects.haskell.org/haskellmode-vim/ ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Mixing cabal and Nix? Or: Best way to install development versions of Haskell packages?
When I use cabal by hand, I don't get a clean Nix environment of course. Is the best way to write a Nix package for the development version of Agda? Hello, there is cabal2nix which works very well. I usually run cabal2nix to get a Nix expression for a package which is on Hackage but not in Nix' repositories and then use nix-env to install it. Note that cabal2nix can handle URLs to .cabal files and that Hackage provides those URLs on the package's page at the bottom. Regards Alexander Foremny Am 9. März 2012 16:18 schrieb Aristid Breitkreuz arist...@googlemail.com: When I use cabal by hand, I don't get a clean Nix environment of course. Is the best way to write a Nix package for the development version of Agda? Note that I figured out a way to get it to work by hand, by passing --force to ghc-pkg (in my last email, when I copied the command the --force got clipped off, but I really had to call it with --force). If I don't use the cabal binary but rather Setup.hs for configure, I do get Using Cabal-1.14.0 compiled by ghc-7.4 But it still finds the system tools like /usr/bin/pkg-config. Either way, it doesn't work without me passing --force to ghc-pkg. Note that if I look at the way Nix packages are installed by the cabal.mkDerivation thing, it also passes --force to ghc-pkg. Aristid 2012/3/9 Peter Simons sim...@cryp.to Hi Aristid, the build log says: Using Cabal-1.10.2.0 compiled by ghc-7.0 That doesn't seem right. That library almost certainly didn't come from Nix. Is it possible that your ~/.cabal and/or ~/.ghc directories contained remnants of earlier builds that were performed with the system compiler? Could you please remove both ~/.cabal and ~/.ghc, and then try the build again in a clean environment? Also, the build log shows several other tools that were used from the system, i.e.: Using ar found on system at: /usr/bin/ar Using gcc version 4.6.1 found on system at: /usr/bin/gcc Using haddock version 2.9.2 found on system at: /usr/bin/haddock Using ld found on system at: /usr/bin/ld Using pkg-config version 0.26 found on system at: /usr/bin/pkg-config Using ranlib found on system at: /usr/bin/ranlib Using strip found on system at: /usr/bin/strip Using tar found on system at: /bin/tar I don't believe that those tools are causing the errors that you're seeing, but still it's a little worrying, especially use of /usr/bin/pkg-config. I hope this helps, Peter ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] [PATCH] bullet 2.78
I seem to have forgotten to actually attach the file. The file is given below. Am 4. Februar 2012 15:24 schrieb Alexander Foremny alexanderfore...@googlemail.com: Hello, attached is a patch that adds bullet 2.78 [1] to the NixOS package repository. I am planning to commit a few Haskell packages needing this a dependency. Because of that this is not the newest version. In case anyone's interested in the most recent version just let me know. I'd be thankful if this could be applied to the repository. Regards Alexander Foremny [1] http://code.google.com/p/bullet/ bullet-2.78.diff Description: Binary data ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] [PATCH] bullet 2.78
Hello, attached is a patch that adds bullet 2.78 [1] to the NixOS package repository. I am planning to commit a few Haskell packages needing this a dependency. Because of that this is not the newest version. In case anyone's interested in the most recent version just let me know. I'd be thankful if this could be applied to the repository. Regards Alexander Foremny [1] http://code.google.com/p/bullet/ ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] wicd managing wireless network
It is true that you have to reconfigure your system every time you add a *new* wireless network you want to connect to, specifically you have to reconfigure every time you change /etc/wpa_supplicant.conf and want to make the changes active. However, once configured wpa_supplicant will take care of getting you connected automagically. It is really much less painful as I think you are assuming. I set up a preliminary Wiki page to help getting you and other users started. https://nixos.org/wiki/Wireless_networking 2012/1/5 rocon...@theorem.ca On Mon, 2 Jan 2012, Sergey Mironov wrote: I have successfully set up wpa2 wireless network using wicd, but it was not that easy. The problem is that dhclient doesn't ignore wlan0 interface by default and wicd doesn't take this fact into account correctly. With just networking = { wicd.enable = true; # useDHCP is true by default }; I would get both wicd and dhclient managing wlan0 interface (well, wicd didn't detect wireless interface originally, that was me who typed 'wlan0' into it's gui settings dialog). The worst thing here is the fact that as a result, wicd logs completly wrong 'bad password' errors. Probably, one should do something to prevent this situation, maybe one of the following: - prevent (wicd.enable == true useDHCP == true) condition - add wireless interfaces like wlan0 to the dhclien's list of ignored interfaces in /etc/nixos/nixos/modules/**services/networking/dhclient.** nix I will be glad to try myself in fixing it. At least, should I add a wiki article describing the problem and solution as is? I wouldn't mind some expert help getting wicd working properly. I barely know what I'm doing. For me, it is a matter that I have no idea how to use wpa_supplicant. AFAIK I have to reconfigure my system every time I take my laptop to a new cafe, not that I know how to configure my system for a new wireless network. -- Russell O'Connor http://r6.ca/ ``All talk about `theft,''' the general counsel of the American Graphophone Company wrote, ``is the merest claptrap, for there exists no property in ideas musical, literary or artistic, except as defined by statute.'' ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Package: vimprobable
I added `vimprobable2/default.nix' and ran `svn diff' from the nixpkgs directory. I am not that familiar with svn and hope this is useful. The output is attached as a file. I also created a NixOS Wiki page for vimprobable. In case you are interested check it out: http://nixos.org/wiki/Vimprobable Regarding the Wiki page: In case you know what to use instead of code tags please let me know and I'll change that. Regards Alexander Foremny 2012/1/3 Yury G. Kudryashov urkud.ur...@gmail.com Alexander Foremny wrote: Hello! I just started using NixOS and seeing that vimprobable [1] is missing in the repositories I created a package for that. Attached is a Nix expression for the most recent stable version of vimprobable2. Send a full patch to nixpkgs/ tree (i.e., adding some/path/vimprobable2/default.nix and adjusting top-level/all- packages.nix), please. -- Yury G. Kudryashov, mailto: ur...@mccme.ru ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev vimprobable.diff Description: Binary data ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] Package: vimprobable
Hello! I just started using NixOS and seeing that vimprobable [1] is missing in the repositories I created a package for that. Attached is a Nix expression for the most recent stable version of vimprobable2. Since I am using NixOS for a very short time I'd appreciate any feedback that can improve the Nix expression since I'd like to create and share a few more packages. If it is acceptable I'd like to get this into the official repositories. Would that be possible? Regards Alexander Foremny [1] http://sourceforge.net/apps/trac/vimprobable/ default.nix Description: Binary data ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev