[Nix-dev] NixOps, MachineDefinition and MachineState
Folks, Looking over and working on NixOps. Can someone tell me what is the rule of thumb what belongs in MachineDefinition and what belongs in MachineState. For example, in virtualbox backend, memorySize is only in the definition and is never "stored?" in MachineState. However the SharedFolders are. https://github.com/NixOS/nixops/blob/master/nixops/backends/virtualbox.py#L27 -- m ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] pytables, numexpr, and pandas
I've finally gotten around to make that pull-request. You can find it here: https://github.com/NixOS/nixpkgs/pull/3056 Thanks for your help! On 15 June 2014 22:11, Mateusz Kowalczyk wrote: > On 06/15/2014 09:09 PM, Andreas Herrmann wrote: > > Thanks for your detailed answer. > > > > On 15 June 2014 02:28, Mateusz Kowalczyk > wrote: > > > >> On 06/14/2014 11:17 PM, Andreas Herrmann wrote: > >>> A) Is there some kind of test suite that I need to run on the > expressions > >>> before I can send a pull request? (I can build and use them...) > >> > >> Simply make sure it builds and runs on top of the current master. For > >> Python, check multiple Python versions. nix-build can help you build the > >> packages. > >> > > > > Okay, it runs on all python versions except pypy. Which is to be > expected. > > However, the pypy branch seems to be somewhat broken. The build failed at > > setuptools long before it reached my package. > > > > > >>> C2) The test-suite of pytables takes quite some time and has a number > of > >> > >> failures of the "not-implemented" type. Is it worth including that > >>> test-suite or should I just leave that one out? > >> > >> I would include any steps necessary to run the tests but after ensuring > >> that the failures aren't NixOS/nix specific, I'd set doCheck = false: > >> this makes it easier for you or someone else to turn on the tests on any > >> future, fixed versions. Make sure to let the maintainer know that there > >> are failing tests. > >> > > > > I dug a little deeper and found that the problem was actually rooted in > the > > hdf5 package. pytables needs it to be built with zlib. I put that in, and > > also fixed the szip package. However, both could be called optional > > dependencies on hdf5. Do you know, how I can make pytables depend on hdf5 > > with a certain set of parameters? Or are these things handled through > > comments and documentation? > > > > To be more explicit: say hdf5 has the parameters `{ stdenv, fetchurl, > zlib > > ? null, szip ? null }`. How can I make pytables depend on hdf5 in such a > > way, that it requires `zlib != null`, but doesn't care about `szip`? > > I can't say for sure but I'd imagine you'd simply override it as usual. > Say you have pytables at > development/python-modules/pytables.default.nix: your entry to > python-modules.nix could look like > > pytables = callPackage ../development/python-modules/pytables { > hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; }; > }; > > python-modules.nix seems to have a whole section for packages defined > elsewhere so perhaps look at that bit. The style there seems to be using > import rather than callPackage however. I imagine it would look similar > to the below: > > pytables = import ../development/python-modules/pytables { > inherit (pkgs) stdenv fetchurl whateverotherdeps; > inherit python numbexpr whateverotherpythondeps; > hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; }; > }; > > Although this is a mere guess: I have not tested this. > > If you have decided to put the package definition in all-packages.nix > then the first way should work fine, just drop pkgs. prefixes. > > > > >>> D1) Pandas works without pytables. However, without it, it cannot > >>> import/export hdf5 archives. Should I add PyTables as a dependency to > >>> Pandas, or should every user individually add both to his environment > if > >> he > >>> needs both? Or is there a way to make it an optional dependency? > >> > >> Optional dependencies are possible but I am unsure how they are done for > >> Python packages. While I don't know how to specify such optional > >> dependencies in python-packages.nix, you can simply create a > >> nix-expression outside of it. See pkgs/games/anki/default.nix for an > >> example of a Python package with optional dependencies. Provide a > >> sensible default because only the default way will be built by Hydra. > >> > >> If you need Hydra to build the package in more ways then you should make > >> two separate entries in all-packages.nix with the different flag setups > >> but if there's only one common case then one should suffice. > >> > > > > I went to the pandas documentation and found out that they actually list > > about a dozen optional dependencies. I came to the conclusion, that it is > > probably easiest to not list them at all, since in the python world such > a > > dependency doesn't require re-building, but just availability in the > module > > search path. No reason to multiply the number of binaries if they end up > > all being the same. > > > > You're correct that there's probably no reason to list them all but if > the package ends up with different features depending on what's > available at build time then perhaps you should allow the user of the > package to toggle these dependencies on, even if they're off by default. > > -- > Mateusz K. > ___ > nix-dev mailing list > nix-dev@lists.science.uu.nl > http://lists.science.u
Re: [Nix-dev] Variable interpolation in strings read from files
Vladimír Čunát writes: > On 06/22/2014 03:45 PM, Florian Friesdorf wrote: >> Now I try to read this file: > > Ah, sorry, I didn't notice that you used the result as a nix string. > > Switching back and forth between nix (strings) and derivations (files) > is better avoided. The readFile function is only meant for what you have > among the nix source expressions. One probably can do more with > "recursive nix". > > Personally, I would try to do all work from that substituteAll point in > derivations and not through nix strings (i.e. catenate by cat command). I've got a working solution: https://github.com/chaoflow/nixpkgs/blob/2efc8fe32239cccab0e1b89b3c0983a2857dd128/nixos/tests/python.nix#L23 Should I move replaceSubstring and interpolateAtAtVars to lib/strings.nix? Suggestions for better naming? -- Florian Friesdorf GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083 Jabber/XMPP: f...@chaoflow.net IRC: chaoflow on freenode,ircnet,blafasel,OFTC pgpgCPZ4wOU6C.pgp Description: PGP signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Variable interpolation in strings read from files
On 06/22/2014 03:45 PM, Florian Friesdorf wrote: Now I try to read this file: Ah, sorry, I didn't notice that you used the result as a nix string. Switching back and forth between nix (strings) and derivations (files) is better avoided. The readFile function is only meant for what you have among the nix source expressions. One probably can do more with "recursive nix". Personally, I would try to do all work from that substituteAll point in derivations and not through nix strings (i.e. catenate by cat command). Vlada smime.p7s Description: S/MIME Cryptographic Signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Variable interpolation in strings read from files
Vladimír Čunát writes: > On 06/22/2014 02:55 PM, Florian Friesdorf wrote: >> Any thoughts? > > I *did* mean using the library function substituteAll. (It's not only a > bash function in stdenv's setup.) It uses practically the syntax you > propose. See qt4 for example. qt4 uses pkgs.substituteAll to read a source file, perform substitution on it and write a target file. It returns the path to the target file. This works and I get a file with variables substituted, e.g.: /nix/store/x32hziqm127agl1ipr6sfs7p9j8zdvpm-preamble.pl Now I try to read this file: testScriptPreamble = { debug, full, pythonstr }: let debug_ = if debug then "true" else ""; full_ = if full then "true" else ""; in readFile (pkgs.substituteAll { src = ./python/preamble.pl; inherit debug_ full_ pythonstr; }); and get: % nix-build python.nix -A virtualenvPython27Full error: string `/nix/store/x32hziqm127agl1ipr6sfs7p9j8zdvpm-preamble.pl' cannot refer to other paths, at /home/cfl/dev/nixos/nixpkgs/nixos/tests/python.nix:26:8 Current full experiment: https://github.com/chaoflow/nixpkgs/blob/5f2341e96cd48c6d75ca9abf7447cc4b04f04611/nixos/tests/python.nix#L26 Is there a way to get this work with pkgs.substituteAll? I'm thinking of something like: testScriptPreamble = { debug, full, pythonstr }: let attrs = { debug_ = if debug then "true" else ""; full_ = if full then "true" else ""; inherit pythonstr; }; in pkgs.lib.substitute attrs (readFile ./python/preamble.pl); -- Florian Friesdorf GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083 Jabber/XMPP: f...@chaoflow.net IRC: chaoflow on freenode,ircnet,blafasel,OFTC pgpaZWpxUqqtc.pgp Description: PGP signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Variable interpolation in strings read from files
On 06/22/2014 02:55 PM, Florian Friesdorf wrote: Any thoughts? I *did* mean using the library function substituteAll. (It's not only a bash function in stdenv's setup.) It uses practically the syntax you propose. See qt4 for example. Vlada smime.p7s Description: S/MIME Cryptographic Signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Variable interpolation in strings read from files
Upfront, I partly talked non-sense before, so I might have transported a wrong picture. Vladimír Čunát writes: > On 06/22/2014 01:11 PM, Florian Friesdorf wrote: >> It would be nice if there would be a way to interpolate variables in the >> string read from ./script.pl, just like the content would be written >> in-place. > > Usually one can use substituteAll; see qt4 for example. > > It uses a different syntax for what is replaced, but one typically does > need a different syntax if substituting in shell-like files. This is working using "import" and some nix boilerplate in the perl files. https://github.com/chaoflow/nixpkgs/blob/7482884953fcd8d3f29d84b864c53c46728d6910/nixos/tests/python.nix#L23 Now, I'd like to get rid of that nix boilerplate. It feels that a library function doing what substituteAll is doing would be great: testScriptPreamble = interpolate attrset (readFile ./python/preamble.pl); I'm happy to switch to whatever variable markup and also to write that function. Just don't want to go a direction that makes no sense. Any thoughts? -- Florian Friesdorf GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083 Jabber/XMPP: f...@chaoflow.net IRC: chaoflow on freenode,ircnet,blafasel,OFTC pgpkVbJRbawxT.pgp Description: PGP signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Variable interpolation in strings read from files
On 06/22/2014 01:11 PM, Florian Friesdorf wrote: It would be nice if there would be a way to interpolate variables in the string read from ./script.pl, just like the content would be written in-place. Usually one can use substituteAll; see qt4 for example. It uses a different syntax for what is replaced, but one typically does need a different syntax if substituting in shell-like files. Vlada smime.p7s Description: S/MIME Cryptographic Signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
[Nix-dev] Variable interpolation in strings read from files
Hi, let a = "Hello world"; in ${./script.pl}; and content of ./script.pl being: print ${a}; It would be nice if there would be a way to interpolate variables in the string read from ./script.pl, just like the content would be written in-place. For more context: https://github.com/chaoflow/nixpkgs/blob/f90ad800b7cea03264137327f9f897938602371b/nixos/tests/python.nix#L23 https://github.com/chaoflow/nixpkgs/blob/f90ad800b7cea03264137327f9f897938602371b/nixos/tests/python/preamble.pl and a workaround: https://github.com/chaoflow/nixpkgs/blob/fdbf736ccc6e53a0454b2cd52858fc8082df8917/nixos/tests/python.nix#L23 https://github.com/chaoflow/nixpkgs/blob/fdbf736ccc6e53a0454b2cd52858fc8082df8917/nixos/tests/python/preamble.pl regards florian -- Florian Friesdorf GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083 Jabber/XMPP: f...@chaoflow.net IRC: chaoflow on freenode,ircnet,blafasel,OFTC pgpX3AZ0zYj1c.pgp Description: PGP signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] nixos tests variables and interactive testing
Florian Friesdorf writes: > Florian Friesdorf writes: >> Florian Friesdorf writes: >>> How can I stop a test, get an interactive shell to investigate things >>> and then continue? It is possible to get an interactive perl prompt. Really nice would be a real shell, with tab completion and things. I assume that something like that could be achieved using ssh. Are there best practices for this? -- Florian Friesdorf GPG FPR: 7A13 5EEE 1421 9FC2 108D BAAF 38F8 99A3 0C45 F083 Jabber/XMPP: f...@chaoflow.net IRC: chaoflow on freenode,ircnet,blafasel,OFTC pgposE8soPHUG.pgp Description: PGP signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Gutenprint cups drivers
This chonfiguration works for me: cupsd_1_7 = { enable = true; gutenprintPackage = pkgs.gutenprintCVS; }; source: https://github.com/MarcWeber/nixpkgs/tree/experimental/cups-1.6-and-1.7 nixos wiki should still contain some hints about how to use "topgit topic branches" efficiently. Marc Weber ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Nix on Mavericks currently completely broken
> John Wiegley writes: > This is just a heads up that if you're on Mavericks running the latest OS X > and compiler, you should not update your nixpkgs repository. There was a > merge yesterday (commit 1b78ca5) which makes several of the core packages > (zlib, gccApple, and more) unable to compile. I've finished pushing the changes needed to get the package set that I use to build on Mavericks. It looks like the new gcc destablized quite a few things, so I'm sure there are other issues lurking. Here's a summary: - gdb_pixbuf: one of the tests now crashes with a bus error, so I switched to using clang to build this derivation - python2.7-gyp: the no-xcode patch that was being used would no longer apply, so I removed it (but will this break the Hydra build machine?) - swig: the swig-ccache tests now fail, so I pass a configure flag to disable the building of swig-ccache - gccApple: needed several new patches to libstdcxx, which is more than a bit troublesome. - ncurses: needed a patch for a bug in clang, though I'm not sure why this crept in just now. - zlib: do not use the new static-libgcc flag, as it doesn't exist on darwin If anyone discovers any other breakages, please let me know here on the list or via GitHub issues. Thanks, John ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Using nixpkgs-unstable channel on NixOS
Hi Mateusz, > What is the proper way to mix two or more channels? I configured services = { cron.systemCronJobs = [ "30 */3 * * * root nix-pull &>/dev/null http://hydra.nixos.org/jobset/nixpkgs/trunk/channel/latest/MANIFEST"; ]; in my configuration.nix. I hope this helps, Peter ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev
Re: [Nix-dev] Request for application 'xkbprint'
On 06/21/2014 10:03 PM, Mateusz Kowalczyk wrote: And adding the appropriate expression at pkgs/servers/x11/xorg/default.nix No, that file is generated from the tarball lists. Pushed the addition both to master and release. Vlada smime.p7s Description: S/MIME Cryptographic Signature ___ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev