Re: [Nix-dev] Auto-generated expressions for applications

2017-05-30 Thread Marc Weber
Let met try to sum up what I remember:

- There 3+ solutions to update "sources" documented on the wiki
  somewhere - ideas from comparing versions with other distributions up
  to adding scrapers getting latest version from web sites if I recall

- Putting automatically generated code into nixpkgs doesn't solve all
  issues, for corner cases you have to duplicate dependencies using
  different version constraints.

  -> overhead

- Its not always quite clear how stable the user wants to be
  (gimp/inskscape) case, master sometimes has new features.

  So which versions to support ?

- Whatever we do, we don't solve anything for other distros (which
  suffer the same problem), unless we switch point of view:

  The solution would be a cross platform cross language dependency
  management system allowing to declare dependencies in a file so that
  you can even install from gihtub automatically.

  systemPackages = [ (fromGithub "user/package" "HEAD") ] # sort rest out on 
your own, thanks

package A could be working, package B could be working, but [A B] in the
same environment not (because they both depend on executable C)

After all we want nixpkgs to be at least stable enough to have broken
packages marked as broken and expect everything else to at least

Which are the best short/middle/long term solutions ?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Nvidia & Cuda & Optimus - root required?

2017-05-12 Thread Marc Weber
> Isn't there some /dev/* file representing the device that you can set
> permissions on? (Half guessing here...)
There are, but chmod 777 on /dev/nvidi* didn't help.

Also it worked on a desktop machine if I recall correctly.
So it eventually is optimus related.

Marc Weber
nix-dev mailing list

[Nix-dev] Nvidia & Cuda & Optimus - root required?

2017-05-12 Thread Marc Weber
Nvidia & Cuda:

As root it works, as user it doesn't (even exporting the env from root).
Easiest way to reproduce:

  $(nix-build cudatoolkit)/extras/demo_suite/deviceQuery

  Either outputs 'FAILED' or some info

Has anybody a solution yet?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] nvidia proprietary / i7 notebook - does not start

2017-05-11 Thread Marc Weber

This worked, almost:

({config, pkgs, ...}: { 
  hardware.bumblebee.enable = true;
  hardware.bumblebee.connectDisplay = true;
  hardware.bumblebee.driver = "nvidia"; = "users";

  hardware.opengl.extraPackages = [ pkgs.vaapiIntel ];
  services.xserver.videoDrivers = ["intel nvidia"]; 
  services.xserver.deviceSection = ''
BusID "PCI:3:0:0"
BoardName "GeForce 940MX"

  (Thanks to

After applying the GDM patch (.66 nivdia driver), I can start X with the
configuratino above, and glxgears -info shows 79 and 780
fpms/sec depending on whether optirun was used. nvidia shows intel or

nix-shell -p python36Packages.tensorflowWithCuda
then optirun python on

  import tensorflow as tf
  # Creates a graph.
  a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
  b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
  c = tf.matmul(a, b)
  # Creates a session with log_device_placement set to True.
  sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
  # Runs the op.

still shows CPU. The nix-shell command worked on a desktop, the test
script worked on ububntu on the same machine. So there is still a small
thing left to explore, but I do no longer have to reboot :)

Thank you very much for helping me.

Should a nixos-hardware-scan be able to detect such cases and write a
configuration like above? Then a nixos-rebuild boot/switch could
'regenerate' the config and warn if your system doesn't match what nixos
expected. Then you can review changes and things just work ?
If there are preferences to be choosen such as nvidia vs nouveau such
choice could be remembered ?

Marc Weber
nix-dev mailing list

[Nix-dev] nvidia proprietary / i7 notebook - does not start

2017-05-09 Thread Marc Weber
Desktop: Everything is fine, the way it should

  lspci: 03:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev 
  => Ubuntu -> fine
  => Nixos -> black -> then blinking cursor, no (EE) lines in X log

I tried copying the relevant part from defining drivers, screens,
monitors from Ubuntus config to no avail. Also setting BusID
AllowEmptyConfig and such didn't seem to work.

Has anybody experienced the same issue/ maybe even solved it?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] The .nixpkgs/config.nix file and user configuration

2017-05-04 Thread Marc Weber
configuration.nix option nixpkgs.config is what ~/.nixpkgs/config.nix is for 
the user in case you missed it.


  nixpkgs.config.allowUnfree = true;
  nixpkgs.config.packageOverrides = p: .. 

You don't have to use config.nix if this is all you need.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] The .nixpkgs/config.nix file and user configuration

2017-05-04 Thread Marc Weber
1) misc.* is best looked by using ctagsWrapped on nixpkgs then looking
  for misc. (or use grep)

  You'll find pkgs/misc/misc.nix:

collection = {list, name} : runCommand "collection-${name}" {} ''
  mkdir -p $out/nix-support
  echo ${builtins.toString list} > 

  If you had a look at other examples you'd try such:

  { ... }:

allowUnfree = true;

packageOverrides: p: {
  myCollection = pkgs.misc.collection {
name = "graphic";
list = [pkgs.vlc];

  then you can nix-env -iA myCollection or such

Marc Weber
nix-dev mailing list

Re: [Nix-dev] The .nixpkgs/config.nix file and user configuration

2017-05-03 Thread Marc Weber
Or ask google "nix/os/nixpkgs config.nix" to find samples and get
inspiration from
nix-dev mailing list

Re: [Nix-dev] The .nixpkgs/config.nix file and user configuration

2017-05-03 Thread Marc Weber

> I don't like the idea of using nix-env,
Why? You can also have your own declarative set of packages "per user".
that's also something config.nix can do:
graphicCollection = misc.collection { name = ... ; packages = [ ... . ]} (from 

nix-env -i graphicCollection

works well for me :)

Marc Weber
nix-dev mailing list

Re: [Nix-dev] The .nixpkgs/config.nix file and user configuration

2017-05-03 Thread Marc Weber
> $HOME/.nixpkgs/config.nix file works.
1) you can install system wide (nixos-rebuild ..)
2) you can install as user into ~/.nix-profile.nix

  ~/.config.nix is to "customize" user nixpkgs by
  - setting settings such as allowUnfree
  - override mplayer to use library X
  - add your own packages FOO

See here:

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Suggestion: programs are *always* in the path

2017-05-02 Thread Marc Weber
> > $ export NIX_AUTO_RUN=1
Well, maybe refactoring would make sense and call it

  run => runs
  ask => asks whether to run or run and install
  ask_install => asks to install
  ask_run => asks to run

or similar. For instance I'd prefer "ask once per app" eventually
because I could have made a typo.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] php-packages fix (broken since multiple outputs)

2017-04-23 Thread Marc Weber
Excerpts from Alastair Pharo's message of dom abr 23 13:34:51 + 2017:
> Sorry, I mangled the link to my PR in my previous email.  The correct
> link is  This is another
> attempt to fix the PHP situation, quite similar to your fix.
Great - didn't look at configure. You took care about php-config and
phpize, so I guess your patch should be preferred.

Who is going to merge it and fix the brokeness?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] php-packages fix (broken since multiple outputs)

2017-04-23 Thread Marc Weber
 FYI I have an open PR for this on github as well:
>  Maybe we can compare notes.
This issue is labeled "systemd-fstab-generator doesn't find fsck.ext3"
thus seems unrelated.

There is not much to discuss because
* current situation is broken
* its known why (includes aren't found)
* The best way to fix it is fixing php-config (because it makes all
  packages compile)

=> The only think to discuss is the "assert" stuff so that in future all
packages can be tested by php71Packages or such (better php71.packages)
even better (php7x.packages) -> but that's another story:
  - adding tests that the modules actually "work" as expected on multiple

The current situation is a stopper for me -> and the fix doesn't make
things worse (testing is as good/bad as it previously was).

Marc Weber
nix-dev mailing list

[Nix-dev] php-packages fix (broken since multiple outputs)

2017-04-23 Thread Marc Weber
Problem: Since outputs = ["out" "dev"] a lot of php-packages stopped
compiling because php-config provided wrong includes
  - moves php-config into
  - patches the includes directory so that headers are found
  - The patch also rewrites the assertion so that I could test all
packages easily by 

  nix-build  -A php71Packages

My question is, is there a different way to run nix-build  -A php71Packages
ignoring assertions so that all php packages can be tested easily?

I'd like to prepare a PR.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] What's the "perfect setup" for hacking on Nix?

2017-04-15 Thread Marc Weber
If you want to change Vim, also have a look at
which allows to load multiple error formats and or
which already has an implementation.

I personally never liked syntastic because it mixed running syntax
checks and running scripts in the same plugin, therefore I forke
It also allows defining multiple checkers and debug which one is
"usable" or not (for instance because executables are missing)

But that's my personal preference. Never added nix cause I use

Marc Weber
nix-dev mailing list

Re: [Nix-dev] What's the "perfect setup" for hacking on Nix?

2017-04-11 Thread Marc Weber
ctagsWrapped -> simple nix support (so that you can jump to definitions)

nix-instantiate --parse-only for syntax checking (vim-addon-nix on my
github page, which also supports kind of follow import path

Nix is dynamic, so there is not that much you can do (except creating
some templates or read code).

Hacking on C++ => ask the communities
  * Emacs
  * Vim
  * Eclipse
  * Atom
  * IDEA
  * Netbeans
  * (100 others)
and judge yourself :)

Typically you also want kind of "open file by typing some chars of the
name" feature.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Use PHP FPM with 2 PHP versions simultaneously

2017-04-06 Thread Marc Weber
=> see comments nixos/modules/services/misc/phpfpm.nix

This code even figures out how many fpm daemons to start.

Thus if you change ini (eg enabling xdebug) you'll get an additional
daemon because you cannot use a pool for it.

Marc Weber
nix-dev mailing list

[Nix-dev] gentoo like nixpkgs globala useflags in nixpkgs config - would it be worth it?

2017-03-24 Thread Marc Weber
Issue pulseSupport -> does it make sense to have a global 'enable pulse
for all packgages' config.pulseSupport = true flag?

packages could be using:  config.pulseSupport or false to disable by
default then.

Gentoo use flags traditionally have been used to enable commonly used
flags such as 'qt support' 'gtk support' or similar.

in the specific pulse case I was told on irc that most packages like
mplayer even work with pulse without having pulse built in.
But same applies to jackd or whatsoever.

The next question is: Which flags might be worth adding right now
(because for instance this would also mean changing flags for sox using
consistent naming which uses enablePulseaudio something flag).

And how / where would those global flags be documented ?

Having a defaultFlags = {
  config.sox = null; # does this cause the package default being used in 
"config.sox or false" ?
  config.pulseSupport = null; # please note: you can enable, but most packages 
will work with pulse without doing so 
  config.qtSupport = null;
  config.gtkSupport = null;

And then there was a common way to document and set the same behaviour
which affects many packages. Maybe there is already a way which I might
have missed?

Thus package defaults could look like this:

pulseSuport ?
  let flag = 'pulseSupport';
  let package = 'sox';
  in config.$flag or config.$package.$flag or false;
 ^ global   ^ package global  ^ derivation default

So you can set nixpgks config to either

pulseSupport = true -> all packages
mplayer.pulseSupport = true -> mplayer only

or still override with .override ( .. ) the known way.

I'm not going to change anything - just want to understand current
situation and whether its worth thinking about it.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] How do you work on big packages?

2017-03-17 Thread Marc Weber
Nix is 'software distribution platform', not a dev platform.

Depending on the task other solutions might be better.

For instance  restarting nginx/ apache the nixos way is also slower than
edit/restart cycle on 'debian'. So use the right tool / env for your

There was a hack to impurely rewrite some dependencies for security
reasons - forgot about it - so maybe you can force impurity to speed up
your workflow.

In the kernel case hat takes most time will be 'building it', thus you
can try 'get compiled data' from your directory (binary distribution)
like, then use something like nixos build-vm or such (disk caching
reasons - no restart required).

You can also try creating links to your 'dev' directory and switch off
sandoxing and add a 'dummy env vars' which you increment to force

Marc Weber
nix-dev mailing list

[Nix-dev] Inkscape pythonEnv - .sif export - PYTHONPATH wrapping

2017-03-03 Thread Marc Weber
A commit turning the list of pythonpackages into pythonEnv broke the
export. The problem is I'm unsure how to suggest a proper fix to
because there are many ways to fix:

makeWrapper requires shell function toPythonPath provided by 
which is "gone" using pythonEnv. Possibilities to fix

  1) revert
  2) "rescue" adding python2 to buildInputs (providing toPythonPath)
  see PATCH below
  3) improve pythonEnv lifting toPythonPath from shell to nix world
  4a) improve pythonEnv adding a run-in-python-env sot hat the wrapped
  script looks like
  /nix/store/bin/python-env/bin/run-in-env /nix/store/...inkscape "$@"

  4b) make it composable / sourcable

  source /nix/store/bin/python-env/nix-support/env
  /nix/store/...inkscape "$@"

No idea which solution is best - thoughts?

People who are maintaining python might want to take care of.

Marc Weber

immediate fix: PATCH

diff --git a/pkgs/applications/graphics/inkscape/default.nix 
index 2f72d00..53d612f 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -31,12 +32,23 @@ stdenv.mkDerivation rec {
 libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
 makeWrapper intltool gsl poppler imagemagick libwpg librevenge
 libvisio libcdr libexif automake114x cmake
+python2 # provides toPythonPath
   enableParallelBuilding = true;
   postInstall = ''
 # Make sure PyXML modules can be found at run-time.
+for i in "$out/bin/"*
+  wrapProgram "$i" \
+--prefix PYTHONPATH : $(toPythonPath "${python2Env}") \
+--prefix PATH   : ${python2Env}/bin || \
+exit 2
 rm "$out/share/icons/hicolor/icon-theme.cache"
diff --git a/pkgs/applications/graphics/inkscape/default.nix 
index 2f72d00..53d612f 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -31,12 +32,23 @@ stdenv.mkDerivation rec {
 libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
 makeWrapper intltool gsl poppler imagemagick libwpg librevenge
 libvisio libcdr libexif automake114x cmake
+python2 # provides toPythonPath
   enableParallelBuilding = true;
   postInstall = ''
 # Make sure PyXML modules can be found at run-time.
+# Make sure PyXML modules can be found at run-time.
+for i in "$out/bin/"*
+  wrapProgram "$i" \
+--prefix PYTHONPATH : $(toPythonPath "${python2Env}") \
+--prefix PATH   : ${python2Env}/bin || \
+exit 2
 rm "$out/share/icons/hicolor/icon-theme.cache"
diff --git a/pkgs/applications/graphics/inkscape/default.nix 
index 2f72d00..53d612f 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -31,12 +32,23 @@ stdenv.mkDerivation rec {
 libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
 makeWrapper intltool gsl poppler imagemagick libwpg librevenge
 libvisio libcdr libexif automake114x cmake
+python2 # provides toPythonPath
   enableParallelBuilding = true;
   postInstall = ''
 # Make sure PyXML modules can be found at run-time.
+# Make sure PyXML modules can be found at run-time.
+for i in "$out/bin/"*
+  wrapProgram "$i" \
+--prefix PYTHONPATH : $(toPythonPath "${python2Env}") \
+--prefix PATH   : ${python2Env}/bin || \
+exit 2
 rm "$out/share/icons/hicolor/icon-theme.cache"
diff --git a/pkgs/applications/graphics/inkscape/default.nix 
index 2f72d00..53d612f 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -31,12 +32,23 @@ stdenv.mkDerivation rec {
 libxml2 libxslt glib gtkmm2 glibmm libsigcxx lcms boost gettext
 makeWrapper intltool gsl poppler imagemagick libwpg librevenge
 libvisio libcdr libexif automake114x cmake
+python2 # provides toPythonPath
   enableParallelBuilding = true;
   postInstall = ''
 # Make sure PyXML modules can be found at run-time.
+# Make sure PyXML modules can be found at run-time.
+for i in "$out/bin/"*
+  wrapProgram "$i" \
+--prefix PYTHONPATH : $(toPythonPath "${python2Env}") \
+--prefix PATH   : ${python2Env}/bin || \
+exit 2
 rm "$out/share/icons/hicolor/icon-theme.cache"
nix-dev mailing list

Re: [Nix-dev] Configure Nix to compile in RAMFS?

2017-02-21 Thread Marc Weber
> is it possible to set Nix to compile in a RAMFS? If yes, how to do this?
fileSystems = [   { device = "tmpfs"; mountPoint="/tmp"; fsType = "tmpfs"; 
options = ["size=2m" "mode=1777"]; }]
(adopt to your liking)
nix-dev mailing list

[Nix-dev] -realise: mounting /proc: Operation not permitted

2017-02-07 Thread Marc Weber
What might be causing this? 

Nix-daemon nix version is the same which gets activated by the command


these derivations will be built:
building path(s) 
error: while setting up the build environment: mounting /proc: Operation not 

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Typing nix − funding campaign

2017-01-12 Thread Marc Weber
> Can you give a specific case where your type system would improve things
> for either users or developers of nixpkgs? In my experience most of the
> nix "code" I write is really just declaration or bash programming, and
> it's not clear to me how different types would help.
Have you never debugged a "got x but y expected" problem? The typesystem
is there, its just lazy as nix is - typed on evaluation.

If you write such code it helps:

But it turned out (oh surpise) that nix is not the best tool to
implement a brute force solver for hackage packages in.

What about guix ?
Does some typing exist here already?

If you need a nice idea about "how to improve the world" - nix guix and
the JS implemenation (and the 100+ other distros) clearly say that a
cross platform cross language package manage / depndency system is
required to derive .nix / guix /whatsoever packages from ..

It should allow "platforms" (like Haskell) to have "stable bases" to
work on.

That would be awesome and the whole open source community & nix would
benefit IMHO.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] How do I know I can enableParallelBuilding?

2016-10-16 Thread Marc Weber
> We should als document why parallel building is disabled by default.
build 3 times -> if it works 3 times you are likely to be fine.
You never know for sure.

mkDervation {
  run = "1"; # should cause rebuild # inc 2 times

whether builds succeed depends on load/ moon /weather / your nose / disk
load / (you get it)

Sometimes the authors know (mailinglist/google/irc)

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Haskell workflow - ghc not in PATH - recommended way / documentation?

2016-06-24 Thread Marc Weber
> nix-shell -A env
my fault - sry.

In the past I used sourceAndTags to get sources tagged (using hasktags)
so that I was able to jump to source using Vim's :tjump command (and
search names) fast.

Is this workflow "outdated" eg because hoogle can do it or should I try
integrating it into current haskell-packages?

hastags fails at "template haskell generated stuff", adding it is
trivial because its just applying

  addHasktagsTaggingInfo = deriv : deriv // {

to an existing derivation. It served me quite well that time.

Marc Weber
nix-dev mailing list

[Nix-dev] Haskell workflow - ghc not in PATH - recommended way / documentation?

2016-06-23 Thread Marc Weber
It's way too much work to keep maintaining my nixpkgs-haskell-overlay.

Trying the workflow specified in the manual:

1) ./default.nix:

  { nixpkgs ? import  {}, compiler ? "ghc7102" }:
  nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./foo.nix { }

2) cabal2nix . >| foo.nix

3) nix-shell --command zsh

however doesn't put ghc in PATH.

BTW: Cabal2nix on cabal2nix seems to fail:

configureFlags: --verbose 
--libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=gcc 
 --enable-split-objs --disable-library-profiling --disable-executable-profiling 
--enable-shared --enable-library-vanilla --enable-executable-dynamic 
Configuring distribution-nixpkgs-1...
Setup: At least the following dependencies are missing:
Cabal >1.24
builder for 
‘/nix/store/9ml89qkri8fkn1bldyh446a2g6rkscjc-distribution-nixpkgs-1.drv’ failed 
with exit code 1
error: build of 
‘/nix/store/9ml89qkri8fkn1bldyh446a2g6rkscjc-distribution-nixpkgs-1.drv’ failed

I'm pretty sure that I missed something obvious ..

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Separate repository for autogenerated lists of urls and hashes

2016-04-24 Thread Marc Weber
I personally think that "autogenerating" packages is the next huge step
to be taken. This requires a database and dependency information for all

Then all distros can benefit, not just

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Python & installation

2016-04-23 Thread Marc Weber
> IIRC the wiki is read-only now on purpose. Its content is being (slowly)
> reviewed and integrated into our documentation.

It would not hurt adding comments to a wiki template:

  The wiki is readonly and will be integrated into the nixpkgs manual.
  See _issue of github_. Thus the only changes which will be done here
  will be "removing content" or "telling that moving all important
  pieces is complete".

Then when all contents have been moved an article could be "deleted" or
marked as "done". How do you keep track of progress otherwise?

A readonly copy could be offered as "archive" (or html dump).

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Python & installation

2016-04-23 Thread Marc Weber
Those are my results

- python27.buildEnv worked

- nixos wiki: still contained the myEnv solution on the python page. I
  guess that should be replaced by buildEnv for "my use case".

  I tried fixing the article but can no longer login.
  Trying to reset password yields "Error sending mail: Unknown error in PHP's 
mail() function."


  pip installed, PYTHONPATH set, error failed to load / import "log".
  => README should be updated about how to install it?

  => fails on matplotlib (png dependencies or such), thus some
  additional hint in the README about how to provide them would be nice.
  I can guess, but I don't like guessing.

  Then it looks very promising.


%pypi2nix requirements.json out

  these derivations will be built:
  building path(s) 
  --2016-04-23 10:08:45--
  Resolving (
  Connecting to (||:443... connected.
  ERROR: cannot verify's certificate, issued by 'CN=DigiCert 
SHA2 High Assurance Server CA,,O=DigiCert Inc,C=US':
Unable to locally verify the issuer's authority.
  To connect to insecurely, use `--no-check-certificate'.
  builder for 
‘/nix/store/5lbb4vnbyxp9f9wcx1ifq910c8xklb8c-pypi2nix-requests-py27.drv’ failed 
with exit code 5
  error: build of 
‘/nix/store/5lbb4vnbyxp9f9wcx1ifq910c8xklb8c-pypi2nix-requests-py27.drv’ failed
  Traceback (most recent call last):
 line 12, in 
 line 143, in main
  tmp = run_buildout(eggsdir, config)
 line 248, in run_buildout
 line 104, in run
  cwd=buildout_dir, shell=True
File "/home/anton_lvov/.nix-profile/lib/python2.7/", line 573, 
in check_output
  raise CalledProcessError(retcode, cmd, output=output)
  subprocess.CalledProcessError: Command 
'['/run/current-system/sw/bin/nix-build']' returned non-zero exit status 100

%cat requirements.json

Marc Weber
nix-dev mailing list

[Nix-dev] Python & installation

2016-04-22 Thread Marc Weber
The question I have is which is the recommended way to install "scrapy
along with dependencies", the following fixes it by making
propagatedUserEnvPkgs equal to propagatedBuildInputs.. is there another

  diff --git a/pkgs/development/python-modules/generic/default.nix 
  index 1fdbd4f..458d187 100644
  --- a/pkgs/development/python-modules/generic/default.nix
  +++ b/pkgs/development/python-modules/generic/default.nix
  @@ -70,6 +70,8 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs 
["disabled" "doCheck"] //
 # propagate python/setuptools to active setup-hook in nix-shell
 propagatedBuildInputs = propagatedBuildInputs ++ [ python setuptools ];
  +  propagatedUserEnvPkgs = propagatedBuildInputs ++ [ python setuptools ];
 pythonPath = pythonPath;
 configurePhase = attrs.configurePhase or ''

Then installing scrapy and setting PYTHONPATH or PYTHONUSERBASE seems to

Full patch adding the missing packages:

Is there an automated maintained way to do such python packaging work I
missed? Sorry for asking such stupid question - I didn't look at python
for a long time.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Using Nix as a package manager (for yet another language)

2016-02-12 Thread Marc Weber
urweb requires C/C++ libraries (eventually).
AFAIK C/C++ package managers don't exist (dependency information) - they
are "encoded in configure scripts and whatnot" - for some universes
(gnome) there are dependency informations available eventually.

Thus for that use case nix is a good fit, because you can "provide a
working set of dependencies" within nixpkgs - and because nix also
forces you to have "one maintained set of packages". Eg hackage
theoretically allows infinite amount of combinations nobody can test in
real life.

All languages I know (Haskell, python, ruby) depend on C libraries and
thus partially suffer from such kind of problem - even Vim depending on
python and whatnot...

Thus yes: Nix is likely to provide results you can live with fast.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] [Bachelors Thesis] Studi-Cloud VMs managing with Nix?

2015-12-11 Thread Marc Weber

Either you put the 'iso's on disk, then each VM has its own data on disk
(may startup faster) - or you "share data" and fetch it via network
(nfs or whatever) - like "network booting", then you can share,
ad you can have "one nixos host" sharing all mysql/postgresql and the
configs required to boot the different systems ..

Having many isos is not a problem - that's why nix has a garbage
collector :-)

The nice thing is using nix you can share the configuration and do both:
generates isos or do network boot (in theory - no idea whether a lot of
work as been done on this ..)

Some packages do depend no "nix" setups (eg /etc/*) thus may or may not
work on regular linux systems as expected.

But serausly, if the profs need etiher mysql or postgresql why not put
both on one iso and be done? Should students switch isos if they "happen
to require the other software .." ?

Because nixos can "switch configurations" there are more options: use
usb sticks, then each prof can provide his config and students can
update their 'usb clone' fast because only differences will be fetched
(doing as much sharing on the stick as possible).

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Please help me with getting the Taskserver service running

2015-11-17 Thread Marc Weber
> The problems I'm facing is mainly the fact that the taskserver wants
> to create certificates and keys[1]. A follow-up problem will be the
> creating of users on the taskserver.
What about describing which kind of user(s) you mean? /etc/passwd ones?
See MySQL service for instance and ids.nix.

Certificates: Apache and similar have settings to tell it which
certificates to use. You want to look at similar services like
ssh/dovecot/... how it is done. I'm unsure.

There are two choices: Either use a pre startup script to create them
(eg mysqlinit or such gets used this way) - or allow user to set paths.

Usually its nice if things "just work" which means generating

Eg mysql does not populate time zone info (mysql_tzinfo_to_sql /etc/zoneinfo/ | 
should it be done? the MYSQL_TZ function requires it (otherwise it returns null)

If nobody has a strong opnion just be the maintainer and make a choice ?

Testing services see nixos/tests/* How to run? See nixos/release.nix or
release-combined. nix-build -A tests.firwall -f release.nix or such.
(I didn't run any test for a long time).

Marc Weber
nix-dev mailing list

[Nix-dev] Fwd: Nix PHP / php-fpm patch suggestion / reminder

2015-08-15 Thread Marc Weber
I tried sending this mail to the mantainer, but his email
address seems to be no longer current.

Thus who is maintaining PHP ?

--- Begin forwarded message from Marc Weber ---
From: Marc Weber
To: robin
Date: Sat, 15 Aug 2015 16:30:53 +
Subject: Nix PHP suggestion:

You're listed as maintainer for PHP

If you use this code

composableDerivation.composableDerivation {
  # merge some php plugins into the derivation, so that the plugins fit the 
PHP version
  mkDerivation = args: 
let php = pkgs.stdenv.mkDerivation args;
in php // callPackage ../../../top-level/php-packages.nix { inherit 
php; inherit fetchgit; }
} (fixed: {

You can use php54.acpu for instance instead of creating php54 package
dictionary. This should make things simpler.

Question: How big is the interest in my php-fpm code currently?
I also have sophisticated php-fpm code which creates the the fpm
instances on its own depending on differing ini files and such because
it creates php-ids to find out which php's differ.

Usage apache looks like this, mind the nice syntax for xdebug:

let php56 = pkgs.php56.merge { fpmSupport = true; gdSupport = true; };

phpfpmPools =  {

  php56 = {
daemonCfg.xdebug = { enable = true; port = 9000; };

# daemonCfg.opcache.enable = true;
daemonCfg.apcu.enable = true;

daemonCfg.php = php56;
daemonCfg.phpIniLines = ''
  extension =
  always_populate_raw_post_data = -1
  post_max_size= ${max_size_mb}M
  upload_max_filesize= ${max_size_mb}M
  memory_limit = ${max_size_mb}M
  max_input_vars = 1

  ; xdebug.profiler_enable = 1
  ; xdebug.profiler_output_dir=/pr/www/xdebug
  ; xdebug.profiler_output_name=cachegrind.out.%t.%R

poolItemCfg = {
 inherit environment;
 user  = marc;
 group  = users;
 request_terminate_timeout = ${timeout_secs}s;
 listen = { owner =; group =; mode = 0700; };

 slowlog = /pr/www/slow-log-5.6;

  extraLines = ''
php_admin_value[upload_max_filesize] = ${max_size_mb}M;
request_terminate_timeout = ${timeout_secs}


FastCGIExternalServer /dev/shm/php5.6.fcgi -socket 
${ phpfpmPools.php56} -flush -idle-timeout 

Marc Weber
nix-dev mailing list

Re: [Nix-dev] YouCompleteMe vim plugin

2015-06-09 Thread Marc Weber
I use such, instead of VAM you can use vundle, however this direct
comparison has shown that VAM event starts up faster.

  vimMarc =
 vim_configurable.customize {
   name = vim-marc-weber;
   vimrcConfig.vam.knownPlugins = vimPluginsUsedByMarcWeber;
   vimrcConfig.vam.pluginDictionaries = [
{ name = ''github:MarcWeber''; }
{ name = ''vim-addon-other''; }
{ name = ''vim-addon-local-vimrc''; }
{ name = ''snipmate''; }
{ name = ''vim-snippets''; }
{ name = ''vim-addon-mru''; }
{ name = ''vim-addon-commenting''; }
{ name = ''vim-addon-sql''; }
{ name = ''vim-addon-completion''; }
{ name = ''vim-addon-async''; }
{ name = ''tlib''; }
{ name = ''vim-addon-toggle-buffer''; }
{ name = ''vim-addon-git''; }
{ name = ''vim-addon-mw-utils''; }
{ name = ''vim-addon-goto-thing-at-cursor''; }
{ name = ''''; }
{ name = ''vim-addon-syntax-checker''; }
{ name = ''vim-addon-rfc''; }
{ name = ''vim-addon-surround''; }
{ name = ''vim-addon-toc''; }
{ name = ''vim-addon-haskell''; filename_regex = 
''\%(\%(l\)hs\|cabal\)$$''; }
{ filename_regex = ''\%(php\|inc\|\|hsc\|lhs\)$$''; names = 
[ ''phpcomplete'' ''vim-addon-xdebug'' ''vim-addon-php-manual'' ]; }
{ filename_regex = ''\.\%(iced\|coffee\)$$''; names = [ 
''sourcemap.vim'' ''vim-iced-coffee-script'' ]; }
{ name = ''vim-addon-haskell''; filetype_regex = 
''\%(cabal\|hs\|hsc\|lhs\)$$''; }
{ filetype_regex = ''\%(rb)$$''; names = [ ''vim-ruby'' 
''vim-addon-rdebug'' ''vim-addon-ruby-debug-ide'' ''textobj-rubyblock'' ]; }
{ filetype_regex = ''\%(rs)$$''; names = [ ''rust'' ]; }
{ filetype_regex = ''\%(nix)$$''; names = [ ''vim-addon-nix'' ]; }
{ filetype_regex = ''\%(vim)$$''; names = [ ''reload'' 
''vim-dev-plugin'' ]; }
{ name = ''sparkup''; filename_regex = 
''\%(html\|xml\|php\|\|inc\)''; }

Documentation see misc/vim-plugins/vim-utils.nix

As alternative you can just install YouCompleteMe and symlink that
directory ~/.nix-profile/... into your vundle dir.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] NixOS won't boot anymore in certain generations, don't know why (Stage-1 error)

2015-06-04 Thread Marc Weber
I also have a problem with luks - didn't debug it yet.
Some lines appear saying that target link already exist.

I can boot this way:

in grub hit e, add boot.shell_on_fail or shell_on_fail,
then you can debug the mounting / boot process, eg enter interactive
shell, then you can mount your partition manually on /root* something

After exiting I can boot. I don't restart often so I didn't investigate.

A google search told me it could be a race condition.

Thus have a look at the shell_on_fail within stage-1 and stage-1 init
scripts to learn more about the startup process - then you can debug.

Marc Weber

nix-dev mailing list

Re: [Nix-dev] cron job to backup a database as part of the configuration.nix file

2015-05-28 Thread Marc Weber
1) writeScriptBin (see samples in nixpkgs)
2)  services.cron.systemCronJobs = ...

nix-dev mailing list

Re: [Nix-dev] Confused about packages

2015-05-19 Thread Marc Weber
Excerpts from Roger Qiu's message of Tue May 19 05:56:30 + 2015:
 Wouldn't it be better for version numbers to always exist?
You're totally right that the

  mkDerivation {
name =name-version

version should always exist. Thus if you find cases just create a topic
branch, fix, and submit once in a while.

I was quite surprised that mysql in all-packages.nix started pointing
to mariadb which broke my ruby overlay because headers were not found.

Thus what can you do?

there is builtins.compareVersions function, and there are nixos module
assertions - thus you could ensure this way that compareVersion
pkgs.mysql equals 5.0 or so - or you could just add a constraint = mysql-5.0 which would fail building.

You always know the version as long as you're using the same nixpkgs
revision - but sometimes you have to update - and then adding such nixos
assertios would be close to what you want. Just grep nixpkgs/nixos for
assertions to see samples.

However usually upgrades just happen to work fine - in the end testing
for versions doesn't protect you from mal functioning (eg a dependency
could have changed) - thus what you really want is writing tests.

There are some samples in the nixpgks repository as well.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Confused about packages

2015-05-15 Thread Marc Weber
 [ with and without version numbers ]
Version numbers get added if people find that there is need to keep
multiple versions. Thus its kind of random

 where / how to find package names

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Overriding a node package

2015-03-27 Thread Marc Weber
Dependencies will be fetched from npm repository - thus is questionable
whethere overriding some packages gets the job done at all IMHO.

I don't know/care atm.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Overriding a node package

2015-03-26 Thread Marc Weber
This patch is outdated, but illustrates what you're looking for:

There is npm2nix utility you have to install.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Why are there so many branches in the nixpkgs repo

2015-02-16 Thread Marc Weber
 We could go over a list of those that are merged (git branch -r --merged
 master), but still for example 'upstart' is a branch that was taken before
 systemd has replaced it. Maybe it should be a tag.
I made the suggestion that too experimental branches / new ideas etc
could be submitted to or so. This would
keep the official repository clean while allowing to submit less common
code or keep more history as appropriate.

In any case I'd vote for a VERISON file which explains a branch's
purpose shortly.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Documentation about releases?

2015-02-15 Thread Marc Weber
One option would be to add a RELEASE.txt to nixpkgs - and everything
would be fine. This would be like the .topmsg file (topgit) which talks
about what a branch is about.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Can we please have text-only on this ML?

2015-02-09 Thread Marc Weber
benefits text:
- minimal bandwidth
- user can configure his/her client how to view - looks always the same
- no js

Thus why are discussing HTML at all - for making some texts *bold*?

HTML also runs the risk to not be displayed the same everywhere - eg
google mail rewrites inline styles (background images) - no idea what
else gets rewritten in strange ways on strange email clients.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Haskell: indexing all packages on Hackage with Hoogle

2015-02-08 Thread Marc Weber
I often don't use hoogle, hack-nix can autotag sources you use for
projects - that is always accurate.

Marc Weber
nix-dev mailing list

[Nix-dev] postfix - generating alias tables in store and some additional changes

2015-01-26 Thread Marc Weber
Is anybody interested in these?


  - use null instead of  for some options which means don't set option at all
to make it clearer that the option is unset rather than set to  which 
postfix defaults apply
  - use default configuration /etc/postfix/ So that sendmail and postfix
flush just works and postconf prints correct configuration location and that
its no longer necessary to pass configuration location
  - remove all the impure ln stuff creating untracked files in the conf 
Instead create .db files in store
(TOOD: !take care about passwords!)
  - replace options extraAliases, postmaster etc by assertions forcing you to
think about creating alias table
  - assemble command dir adding links to sgid wrapped applications correctly

  TODO: merge with upstream changes

If so I'll try to clean up and submit a PR.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] recent calligra breakage - how to prevent?

2015-01-25 Thread Marc Weber
We could also introduce nixos style

  executables.krita.checks.--help = true;
  executables.krita.checks.exists = true;

test -x $out/bin/x
test -x $out/bin/y

Is duplicate testing code

  for prog in x y; do

makes it harder to debug what's going on, because shell script will
exit at line foo - its still simple enough

for prog in x y; do
  $out/bin/$prog || { echo prog $prog is missing; exit 1 }

is that much code that its worth moving into IMHO
which is why I'm asking - because documentation purpose could be helpful
as well.

If in doubt - be simple - but version is best ? ..

For the time beeing I'll keep as is - after all I'm human, the next time
I'll know where to look at if krita is missing.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Why Bash and Nix-Shell have no completion?

2015-01-25 Thread Marc Weber
It got implemented somewhen in the past, some people told about
bash completion being annoying in some cases (- [1]) .. which means the perfect
solutions means conditional opt-in/out eventually.

bash.nix has:

  interactiveShellInit = ''

I personally have patches putting a

  source /etc/bash/setup-all

in ~/.bashrc as default which means:
  1) user can edit .bashrc (because its not a symlink)
  2) user can opt-out easily
  3) user can look at setup-all which allows him/her to opt-in/out from
individual features or completion scripts, such as individual
completion scripts..
  - [1]

those patches change quite a lot - and I'm unsure whether its worth
merging them into master.

I want to say: Builders should be as clean as possible eventually.
Thus opt-in makes sense - look at ~/.bashrc and source that script
to enable default behaviour ?

Marc Weber

[1] This is the sample code of my /etc/bash/nix-bash-lib which gets
sourced by /etc/bash/setup-all, it opts-out from gnu utils which was
reported to be annoying long time ago - so it might be outdated.

You could use such in your .bashrc

  NIX_COMPL_SCRIPT_SOURCED[the-individual-compl-script] = anything 
  source /etc/bash/setup-all

to opt-out.


  # potential problems (-rev 20179)
  #  - It doesn't support filenames with spaces.
  #  - It inserts a space after the filename when tab-completing in an
  #svn command.
  #  - Many people find it annoying that tab-completion on commands like
  #tar only matches filenames with the right extension.
  #  - Lluís reported bash apparently crashing on some tab completions.
  # comment: Does this apply to complete.gnu-longopt or also to bash_completion?

  if shopt -q progcomp /dev/null; then
# bash supports completion:
  local profile=$1

  # origin: bash_completion, slightly adopted
  # source script only once - allow user to use NIX_COMPL_SCRIPT_SOURCED to
  # opt out from bad scripts. If a user wants to reload all he can clear

  local nullglobStatus=$(shopt -p nullglob)
  shopt -s nullglob
  for s in $profile/etc/bash_completion.d/* 
$p/share/bash-completion/completions/*; do
local base=${s/*\//}
]]  { . $s; NIX_COMPL_SCRIPT_SOURCED[$base]=1; }

  eval $nullglobStatus
nix_add_profile_completion(){ :; }
nix-dev mailing list

[Nix-dev] recent calligra breakage - how to prevent?

2015-01-24 Thread Marc Weber
Recently calligra broke.

I'd like to introduce a simple patch like this:
It should ensure that the build fails eg if krita is missing. The
problem was that updating eigen caused calligra to determine krita
cannot be build, so everything else of the suite was build.

Now this is a hack - what about being more declarative introducing

mkDerivation {

  expect.executables = [krita ...]


Later this could also be used for documentation purposes - eg finding
packages which provide some specific executables.

Does this already exist?

Marc Weber
Im Tannhoernle 4/1
D-78052 Villingen-Schwenningen

Mobil: 017660032282

Steuernummer: 22483/ 29259
Finanzamt Villingen-Schwenningen
nix-dev mailing list

Re: [Nix-dev] How to create dirs needed by a module before it runs?

2015-01-23 Thread Marc Weber
Why not cd into the modules directory and grep for mkdir?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] parallel make (was: Again: Why don't these people havecommit access)

2015-01-20 Thread Marc Weber
How complicated is it to override mkDerivation in nixpkgs passing
  parallelBuilding = true ?

I think we have a documentation issue. There should be flag such as:

  parallelBuildingPossible = yes/sometimes/no;

instead of parallelBuilding = true.

Then Michale Raskin's tests would not fail on packages which are known
to not build correctly ...

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Again: Why don't these people have commit access

2015-01-19 Thread Marc Weber
 Marc I think it's the general case of more complex PRs. PR that change too
 much or add too much tend to be delayed. Not only because they are harder
 to test, but also harder to agree on by more peopl
Well - I did take care - I added the new cups version as opt-in.
It was your choice. You were free to keep using the old one.

I think history is history.. we should talk about the future which also
might affect guix (

In the Vim community people leave over and over again because patches don't get
accepted or are not taken care of. Just about 2 days ago there was another case.

I think that being able to use nixos as desktop system (which implies being
able to print) should be a high priority.

We also have a new situation compared to back in the old SVN days:

  _We have releases_

Thus breaking stuff is still bad, but maybe less bad than before.
The problem is: We all need stable systems - thus if everybody uses the stable
systems nobody is going to use the less stable - thus less testing will happen.

But let's talk about a specific case: My patches to apache httpd module:

The apache one breaks the API because I don't want to mess with port stuff
(to not mess with .htaccess) so I just created my own loopback device ..

Figuring out how to patch this in a backward compatible way was something I
could not afford.

My current situation is that I update my system only once every couple of weeks
because I cannot afford recompiling everything over and over again.

 Just to say, it's not lack of trust, or being negative. It's lack of time
 (or platform) for proper testing and lack of time for proper understanding
 (linux is becoming too giant) the consequences of a change.
Well - NSA cases and the one fosdem video (what would I do If I had one million 
$ and
if it was my task to compromise the world ..) was fun to watch:

Thus to truly improve you also have to start measuring who reviewed commits
to maximize value by spent time - and that not only for nixpkgs but also for
projects like openssh.

There is no way to ensure that an update will not cause a random failure
on hardware X which will happen only once a month.

One huge benefit from having commit access would be that experimental or
complicated stuff could be submitted as topic cranch to increase visibility
and that other people can join such effort and help taking it to a level where
it can be merged. I love topic branches because they use two files:

  = The commit message which would be created when all commits got collapsed.
  The nice thing is that each branch documents its purpose on its own.

  A list of other branches it depends on

Then there is a tg update command to merge with all dependencies and a tg
export command to collapse in order to yield a nice commit which can be
reviewed more easily.

The wiki contains a longer introduction. I don't say topgit must be used.
But I highly recommend having such topic specific file documenting the purpose
of a branch

That's another story: do we want many official experimental topic branches?

Making experimental branches visible to others would improve collaboration a

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Again: Why don't these people have commit access

2015-01-18 Thread Marc Weber
I can only speak for myself:
In the past the community or some members didn't accept what I did for
various reasons. That's why I did no longer run for 'commit' access
since then.

A summary with some cases (some time has passed, maybe my memory is no
longer that accurate - but it should give an idea):

- patches about parallel building got stuck
  = result: 3 people (Lluís Batlle, me , Peter)
  tried different implementations. The first patch was not accepted
  for no reply is no ok reason - I didn't get a ok due to minor
  refactoring of make arguments in builder and because some people 
  feared about purity (it would have been opt-in)

  I messed up hydra that time (due to some -n -j being interpreted 
  as run as much as possible)

  It was pretty depressing for me because I had need for -j 4
  and not getting it into nixpkgs made it impossible for me to use

- patches about cupsd got stuck (due to using versionedDerivation)
  = fixed printing for me - was later asked on the mailinglist for)

- I did mess up python once and did not have time within 5 days or so to
  fix it - those had to be reverted by Eelco Dolstra

- Work on php-fpm was done twice, by me and by somebody else.
  My version of php-fpm is more complicated but also very complete
  because it determines how many php-fpm daemons to start on its own.

- I eventually had pushed the zsh/bash patches (which I guess are
  partially obsolete now) - they allow users to opt-out and allow
  modules/the admin to define bash/zsh snippets to be added
  to a global bashrc/zshrc which gets sourced by ~/.bashrc
  so that users can opt-out from everything or pieces.

- I would have fixed eigen(2) in krita of calligra much faster
  = Thus because I have not had commit access this had to be debugged

- I have patches pending for apache http and nginx making them more
  configurable (eg allowing to set the IP to listen to)

 To sum up: I tend try to apply the 20/80 rule: 20 percent of effort
should yield 80% of the desired result - which seems not always to be
good enough.

Thus in the past I caused both: goodness and badness - thus its fine for
me that my commits get reviewed.

Thus if PR's don't get accepted I do no longer take it personally -
changes end up in my topic branches instead.

I treat Nixos to be a very good option to get some jobs done - still
seeing much room for improvements. Eg there are 3 implementations:
nixpkgs/a js one and guix. Thus moving towards a global package
database more distros could derive package descriptions from
is much more important to me than caring too much about policies
- because I see Nixos to be a tool only to get a job done.

Marc Weber
nix-dev mailing list

[Nix-dev] announce: patch introducing resource tracking

2015-01-15 Thread Marc Weber
The idea is to prevent the admin from starting multiple daemons
accessing the same directories or using the same ports by accident.

My updated patch [1] depends on it:

I'm little unsure whether tcp/udp should be tracked differentyl or by
keys tcp:80 udp:80 or such.

Are there more resources which are worth tracking ?

I recommend looking at the patch because it could serve as sample for
similar cases such as multiple postgresql instances or whatsoever.

Marc Weber
nix-dev mailing list

[Nix-dev] Multiple instances - detecting resource collisions - nixos module system question

2015-01-14 Thread Marc Weber
If you use multiple apaches/nginx/mysql/postgresql/whatever instances
its likely to miss adjusting the port or whatsoever. Therefore I'd like
to implement a simple resource tracking module which fails if a
resource such as tcp/ip port or socket or such gets used multiple times.

It should look like this:

A test like this:
   resources.tcp-ports.80 = {};

  The option `resources.tcp-ports.80.allowCollisions' defined in 
`/etc/nixos/nixpkgs/nixos/modules/misc/resources.nix' does not exist.

which I don't get because the dpaste sets a default value for

Thus does anybody just spot what I'm doing wrong?

If we are at it: Eelco Dolstra proposed or
such. What about services.mysqls ? We could deprecade services.mysql
then and ask users to switch slowly. No naming collisions. Naming is
short and could be adopted to other services.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] newbie question: Which name is used for eclipse-sdk-4.4 in /etc/nixos/configuration.nix

2015-01-06 Thread Marc Weber
 (Unfortunately I don't know a good reference to point to for a
 description of this.)

Marc Weber
nix-dev mailing list

[Nix-dev] Multiple MySQL instances (or nginx/apache/...)

2015-01-03 Thread Marc Weber
How should this be written in the future ?

I've submitted a pull request which tries to change not much lines to
reach my goal - however I agree that it might not be the perfect
solution yet:

This change adds a parameter moduleName to the mysql module which then
gets used for most defaults (pid file, data dir and so on)

{ moduleName ? mysql}: # eg pass mysql2 to add a second mysql

services.${moduleName} = {
   enable = mkOption {
 default = false;
   user = mkOption {
 default = moduleName;

Final usage look like this:

   imports = [
(import (nixpkgs+/nixos/modules/services/databases/mysql.nix) 
{moduleName = mysql_on_tmp; })

services.mysql_on_tmp.enable = true;
services.mysql_on_tmp.port = 3307;
services.mysql_on_tmp.package = pkgs.mysql55;
services.mysql_on_tmp.dataDir = /tmp/mysql;
services.mysql_on_tmp.socketDir = /tmp/mysql_tmpfs.socket;

ids.uids.mysql_on_tmp = 2;
ids.gids.mysql_on_tmp = 2;

If there are existing beter solutions let me know and or comment to
either the pull request or this thread.

I guess the most interesting point is uid/gid handling.

Introducing a style will affect almost all services ..

lethalman proposes such style: = ...

I agree that this style is nicer. Do you agree?
Should services.mysql be mapped to services.mysql.instances.default then?
Then backward compatibility could be preserved.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Multiple MySQL instances (or nginx/apache/...)

2015-01-03 Thread Marc Weber
Excerpts from Ertugrul Söylemez's message of Sat Jan 03 14:05:05 + 2015:
 But don't hold your breath.  It could take a week or two before I can
 present my first prototype.
Maybe you can sketch your idea for the sake of discussion?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] How to get rid of systemd (was: Modifying the init system (introducing S6 supervision suite))

2015-01-03 Thread Marc Weber
Let me comment:

- Is systemd a step backwards?
  * upstart didn't even implement logging, did it?
  * some more things I think systemd does better than upstart (eg socket

  However I agree that journalctl is horribly slow.

- Must the module system or systemd go away? I don't think so.

  why not add a new option

  services.my_modular_thing = mysql  postgres  bitlbee  ..;

But what is the goal?

domain_1 = foreign_domain;
domain_2 = domain_managed_by_X;
ssl_cert = yyy;

php_app = new wordpress_instance {
  databases = [
{ type: mysql;
  timeouts: foobar;
  require_mysql_import_in_path = true
  http = [ 
{ domains = [domain_1 domain_2]; port = 8080; }
{ domains = [domain_1 domain_2]; port = 443; inherit ssl_cert; }

container_1_amazon_eu = {
  apps = [ php_app ];

container_2_load_balancer_with_instances  {
  apps = [];

realise [container_1_amazon_eu container_2_load_balancer_with_instances ];

But still, how to move the app from container_1_amazon_eu to
container_2_load_balancer_with_instances ?

Then due to TTL in DNS there is much more to take into account such as
HTTP proxies, mysql replication (if you want minimal down times) and

Thus a 

can this be done with a configuration file at all?
what should move_to_container_with_minimal_downtime ideally do?

  1) prepare the second container (create user account, database)
  2) start mysql replacation (eg lock database in container 1, create
  btrfs snapshot, read replacation state, unlock, copy btrfs backup to
  container_2_load_balancer_with_instances, start replication, wait
  till its in sync)
  3) stop web app @ container_1_amazon_eu, setup http proxy to new IP,
  4) garbage collect (thus delete all account/database stuff @

How can this be expressed using a simple text file ?
Some things just require global state IMHO ..

So what do we really want ?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Request for comments: pinky-promise determinism

2015-01-02 Thread Marc Weber
I've talked to git (irc) long time ago, they are pretty sure that the git
hash would serve well as alternative to a sha256 or md5 hash.

Thus adding an implementation for
mkDerivation {
  git_hash = ; # instead of fixed output hash
and have the nix implementation check for $out/.git and, git status
returning nothing and HEAD being the desired hash would be much easier
to use.

Most Vim plugins also are stored on github.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Haskell NG

2014-12-12 Thread Marc Weber
  - hackage-packages.nix is generated automatically by the hackage2nix 
from the v2.x branch of the cabal2nix repository [2]. The file defines
builds for the respective latest version of every Hackage package.
hackage2nix can include some older package versions, too, if necessary.
So does the spirit behind hack-nix win finally? Finally? :)

If we rewrite the stuff we should get it right this time.
I feel getting this right means
1) versioning hackage
2) implement a way to retrieve hackage packages (either by api or from
  versioned hackage dump)
3) share package resolution with cabal (don't invent our own stuff -
  because it will always be a lot of work and be totally different)

AFAIK Shea has added a way to load .dll functions. I think I remember it
is possible to call Haskell from C code. Thus what about collaborating
on the implementation sketched above?

It would serve as sample which could be adopted for the other
universes (perl/python/ruby/java/scala/rust/vim/emacs/whatever).

Thus how could usage look like?

haskellPackages {
  hackage-dbs: [
my custom stuff
  resolve: bytestring

Due to referencing a hackage like database by date it should be
Fetching all versions of a package could be done by API (HTTP) or such -
thus downloading hackage would no longer be necessary.


This is the next thing I'd try trying to learn from hack-nix.
For all of you who don't know what hack-nix is: Its a brute for
dependency solver written in Nix reading a hackage database which was
serialized to a .nix file doing exactly what Peter wants to implement:
Latest versions + some manually added older versions to make packages
resolve. Additionally its easy to add your own packages (eg dev
versions) and call the solver as well as patch packages (eg .cabal
files, especially its dependency information) before turning it into a
huge .nix file.

You can find a short description

It was meant to be a proof of concept. Now I'd like to ask you whether
you would prefer joining a common effort which is most likely to work.

Its too painful to role my own solutions for everything (haskell, ruby
overlay etc - even though it often works nicely - and fails due to lack
of man power).

Peter: Please comment on the proposal, I'd rather join than keeping my
own stuff, but your attempt just seems to be another hack-nix with all
of its problems.

Who would join implementing the design I've sketched above?

Live is too short IMHO. My point of view might be limited - thus if I
make any bad assumptions please tell me.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] How can I write a library inside Nixpkgs? (for Bitcoin and friends...)

2014-12-08 Thread Marc Weber
What about reading the nixpkgs (the sections describing what a
derivation is) manual and or having a look at the nixpkgs repository
which should contain more than enough examples ?

Marc Weber
nix-dev mailing list

[Nix-dev] vim-plugins

2014-12-02 Thread Marc Weber
Leave your comments about this pull request, please:

Now its possible to put all of your plugins into a ~/.vim-scripts [1] files
and almost derive your nix configuration from it by doing some simple
copy pasting, see vimUtils's documentation.

Is a .nix file the appropriate place to put such documentation, or would
you prefer another location such as wiki or nixpkgs manual?

Marc Weber

[1] See 's README file
nix-dev mailing list

Re: [Nix-dev] Postgis issues

2014-11-18 Thread Marc Weber
postgis was added by me many years ago, I guess nobody since then looked
at it. That time it was neccessary to prepare a databse before you were
able to use postgis - to simplify I added helper scripts like this:

Things might have changed a lot.

 Rebuilding OS works fine. Postgis appears to install (I can see, but i'm missing `postgis.control` and presumably one 
 extra step?
Eventually add use such installPhase:

installPhase = ''
  unset installPhase

and use the -K flag when building, then you can have a look at the build
directory as well.

= Neither the source nor the build nor the install directory contain
any .control files

 'CREATE EXTENSION postgis; ERROR:  could not open extension control file 

Looking at it looks like there are newer
versions as well:
  postgis-2.1.4.tar.gz pdf html (Release Notes)
  postgis-2.0.6.tar.gz pdf html (Release Notes)
  postgis-1.5.8.tar.gz pdf html (Release Notes)

Thus which ones do you care about?

This file (replace the postgis file) makes 1_5_8 build providing the
shell script, probably it still just works:

The newer versions I added as well don't build yet for this reason:
  gcc: error: ../liblwgeom/.libs/liblwgeom.a: No such file or directory

there is a file, however replacing the .a version with the
.la version in makes gcc not know the file.

Does any C guru just know what's going wrong?

. o O (Yes - I know that I should rewrite composobaleDerivation ...)

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Introducing nox and nox-review

2014-11-12 Thread Marc Weber
is the place to add a reference..

Marc Weber
nix-dev mailing list

Re: [Nix-dev] system wide .vimrc / managing plugins the nix way - proposal and implementation

2014-10-27 Thread Marc Weber
Now that that it does make sense to think about moving your .vim config
into nix space it also makes sense to package most commonly used
plugins. Thus if you think a plugin is missing in vimPlugins send me a
private mail and I'll try to include it using the vimp-pi = nix export
when creating the pull request.

If you're using VAM you can create a list of plugins in use by

  :echo keys(g:vim_addon_manager.activated_plugins)

Marc Weber
nix-dev mailing list

Re: [Nix-dev] system wide .vimrc / managing plugins the nix way - proposal and implementation

2014-10-27 Thread Marc Weber
 4) And I thin[*k*] we have to rename `dependencies` to smth like
 `runtimeDependencies` and make them the same type as `buildInputs`, not the
Well runtimeDependencies could be executable tools. That dependencies
attr only lists vim plugin names. We could flag derivations to be a vim
plugin and traverse the dependenciy tree (runtime/build dependencies),
but that would be more work (cpu wise) probably.

I notice that we can do the same for pathogen: install all dependencies,
thus the interface changed slightly to

pathogen.pluginNames = [...];
vim.pluginDictionaries = [..];

and vim-addon-nix will also install all depnedencies.

Marc Weber
nix-dev mailing list

[Nix-dev] system wide .vimrc / managing plugins the nix way - proposal and implementation

2014-10-26 Thread Marc Weber
Well - it might be desirable - but for other users vim should be the way
they know it - plain simple stupid. Thus forcing a customized vim
behavior on other people is could be a pain.

The first step for letting the users choose is
- create nix code creating .vimrc files
- create vim wrappers which use them, eventually having a different name

This patch implements this:

More than that VAM (vim-addon-manager) got a autoload/nix.vim file which
can turn github based plugins (known by vim-pi) into nix derivations.

I'm not sure I should call myself of being a maintainer of anything
within nix, its just what I think will provide greatest value with least
effort. This change was driven by the discussion found here:

The perfect fix (creating a huge package cross language/tool packagce
database) would be a lot more work, putting all vim plugins into nixpkgs
( 5.000 - a lot are no longer used) would be overkill. Thus this
attempt tries to follow the cabal2nix like approach making packaging 
plugins people use easier while supporting enhancements such as
addon-info.json files introduced by VAM containing simple unversioned
dependency information.

The result looks like this illustrating how much the unversioned
dependency management of VAM can simplify your setup:

# test cases:
test_vim_with_vim_addon_nix_using_vam = vim_configurable.customize {
  name = vim-with-vim-addon-nix-using-vam;
  vimrcConfig.vam.plugins = [
{name = vim-addon-nix; }
test_vim_with_vim_addon_nix_using_pathogen = vim_configurable.customize {
  name = vim-with-vim-addon-nix-using-pathogen;
  vimrcConfig.pathogen.plugins = map (x: vimPlugins.${x}) [
# target package:
# dependencies:
vim-addon-completion vim-addon-goto-thing-at-cursor
vim-addon-mw-utils vim-addon-actions vim-addon-errorformats tlib

The depeendency magic is provided by a dependencies = [name1 name2]
attr in vimPlugins.

Please note that all features provided by VAM's vam#Scripts() function
are supported such as loading plugins lazily triggered by you opening
some special particular filetype.

Because pathogen and VAM are supported (sorry no Vundle/ NeoBundel
support yet) this should please the majority. Pathogen has no advantage
over VAM AFAIK - I just added it for completness and because the
discussion mentioned above asked for it.

This mail is for gathering feedback, I'll create a pull request soon.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Best way to install a bunch of old Python packages

2014-09-26 Thread Marc Weber
I once tried

Like nixpkgs-overlay and hack-nix this uses a different approach:

a) dump everything from pypi into a format readable by nix
b) use a package description to assemble derivations on the fly.
  This is using a simple brute force solver, if two different package
  versions get resolved in the ruby/python case it will simply raise
  an error and stop, then you have to hardcode one. This could be done

I didn't get far because the that time I noticed that a lot of python
package had not proper dependency information which was readable outside
of python (without running

Currently the dump I created is heavily outdated.

Thus yes: There are alternative ways - and I think that its the future
to provide mirrors of pypi - you can download piecewise(!) as needed.
Because in the ruby case there are 40.000+ packages - and you don't want
to download them all if you want to install 5 packages.

You can get an idea about how it should have looked like here:

Yes - my implementation is just a prototype and could be horribly

By the way: I think the perfect goal would be creating huge package
databases, so that all software could be installed that way - but that
would also be a lot of work - because each language has its own
constraint. Eg for node its fine if you have

A - B-1.0
 `- C - B-2.0

Because A/C will both get a different view on B

Marc Weber
nix-dev mailing list

[Nix-dev] PAGER=less -R

2014-09-08 Thread Marc Weber
topgit has an issue with that:

TG_PAGER gets defined some lines above ${FOO-xxx) means but word if FOO
isn't defined (thanks to Lethalman, I failed finding that in the man

Is the best way to fix this by dropping quotes? Does anybody know how
PAGER ist most commonly used?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] PAGER=less -R

2014-09-08 Thread Marc Weber
Fed upstream:
Thanks for tv @ irc for helping.
nix-dev mailing list

Re: [Nix-dev] haskell: overriding mtl/any builtin

2014-09-07 Thread Marc Weber
 mtl choosing versions
Which is the target package you want to use/work on?

Marc Weber
nix-dev mailing list

[Nix-dev] Is xdebug working for you?

2014-08-15 Thread Marc Weber
Is anybody using xdebug?

The change making PECL build it broke it for me.
This code still works fine.

Maybe I have to configure it in a different way when it gets build by

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Vim setup for Haskell

2014-08-04 Thread Marc Weber
Excerpts from Thomas Strobel's message of Mon Aug 04 07:09:11 + 2014:
 The idea behind 'hvim' is to have a single package which installs vim
 with some stuff that is helpful for Haskell development, without having
 to understand how nixos or vimrc work.
Learning Vim take so much time that unerstanding .vimrc is trivial, sry.
For that reason that is your way, but not mine ..

 Especially it should allow to distribute adjusted or modified programs
 and plugins which work together nicely.

 I know about your vim-addon-manager project and your maintained
 collection of vim plugins for nix**.
No, I don't maintain it. I just tried to get the basics right, so that
people who would have added vim stuff anyway get it right.

In fact I think there is one thing missing to have a perfect software
distribution: Authors taking care themselves.

VAM is in maintainance mode for two reasons:
  - there will be neovimm
  - I'll be creating this as soon as I have time:

The idea I want to explore is whether it is possible to create a huge
database with recipes so that you can turn those cross language recipes
into .nix derivation or *any distro package specification*

Eg updating kde/xorg/gnome is always a lot of work. That's why I want
to fix this once and forall.

Eg there are combinations Vim  Ocaml YouCompleteMe which requires
recompliing vim (with py support) and running ocamlopt to get a working
setup. VAM will never be up to that task.

Thus if you like idea behind YPM or want to sponsor it just star it or
let me know :)

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Vim setup for Haskell

2014-08-03 Thread Marc Weber
I personally use nixpkgs-haskell-overlay
and vim-addon-haskell which can run cabal.

The nixpkgs-haskell-overlay implementation is prototype implementation
(see wiki) and can tag haskell sources (using hasktags).
You then source an env var which sets an environment var pointing to tag

There are alternative solutions, too

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Better support for Ruby

2014-07-28 Thread Marc Weber
Excerpts from Charles Strahan's message of Sat Jul 26 19:43:29 + 2014:
 Hi all,

Well - depends on what you're looking for.
nixpkgs-ruby-overlay has been in use by me for a long time and often
does a resanobly good job

There are some minor problems such as you having to download a dump of
RubyForge (which I don't update regularly right now).

It does not support lockfiles yet - but you could turn lockfiles into
that such .nix code.

The best thing would creating a mirror and fetching package descriptions
on the fly via API on demand - but with defined revision so that
results can be reproduced.

I started this alternative approach after giving up on the generate
.nix files for nixpkgs for both Haskell/ruby. I also tried this for
Python, but that time I failed because dependency information on PyPi
was weak or dynamic (determined by setup scripts) often.

Thus the way to move forward would be creating a global package
database which contained all information for everyone.

(And also make C/C++ gnome and whatnot folks use it ..)

That's my view - it could be incomplete.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Better support for Ruby

2014-07-28 Thread Marc Weber
Excerpts from phreedom's message of Mon Jul 28 13:54:21 + 2014:
 There's nothing inherently wrong with the old nix gem if you treat it as a 
No, that time it took runnig a gem command (the very first implmentation)
made me look for an alternative.

Marc Weber
nix-dev mailing list

[Nix-dev] cgroups, cpu.rt_runtime_us

2014-07-20 Thread Marc Weber
While trying to run jack1d I noticed that I had to change some limits:

security.pam.loginLimits = [

# jackd:
{ domain = @audio; type = -; item = rtprio; value = 100; }
{ domain = @audio; type = -; item = memlock; value = 25; }
{ domain = @audio; type = -; item = nice; value = -10; }

as well as assign cpu.rt_runtime_us (otherwise sched_setscheduler

  echo 90  /sys/fs/cgroups/cpu,cpuacct/user.slice/cpu.rt_runtime_us

Is there a systemd way to set cpu.rt_runtime_us value or is it most
simple to just create a startup script assigning it?

Eg nixos manual and
mention some specific settings such as MemoryLimit, but I didnt't find a
rt_runtime_us setting there.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Writing a Nix evaluator in Haskell

2014-06-29 Thread Marc Weber
 As such, I've started a project call hnix which will implement a parser and
 evaluator for Nix in Haskell.  I have the parser working for simple
 expressions already (using either Parsec or Trifecta, it works with both).
AFAIK Peter Simons has written a parser previously, too. Maybe search in
the mailinglist archives to join efforts

See here:
Subject: Haskell Parser for (subset of) Nix

 My first goal is a syntax verification
vim-addon-nix has been using it for ages:
nix-instantiate --parse-only foo.nix does a syntax-check
You may want to use it till your alternative is ready.

Comparing with an Haskell implementation would be fun for many reasons,
using multiple cores for instance.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] cabal.mkDerivation and cabal flags

2014-06-24 Thread Marc Weber
The problem with flags is that dependencies might change. No idea how
cabal2nix handles this. Maybe you have to rerun it with flag info.

The alternative is using hack-nix which creates the dependency
information on the fly anyway - but the database might be a little bit

Thus have a look at cabal2nix and hacknix. If you want to give the
latter a try let me know.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Gutenprint cups drivers

2014-06-22 Thread Marc Weber
This chonfiguration works for me:

  cupsd_1_7 = {
enable = true;
gutenprintPackage = pkgs.gutenprintCVS;


nixos wiki should still contain some hints about how to use topgit
topic branches efficiently.

Marc Weber
nix-dev mailing list

[Nix-dev] apache module and ip:port configurations?

2014-05-29 Thread Marc Weber
For fun I tried placing apache behind nginx.
making apache listen on non standard port made existing installations
such as wordpress return redirects. (Yes, could be fixed, ..)
I tried setting up a second loopback device so that I was able to use
port 80 twice (once for nginx proxy_passing requests to apache then
listening on an arbitrary local network address different from

The problem I faced was that the apache module did not allow me
specifying it. The attached patch fixes this, but replaces
port = 80; by a more complicated listen = [{ ip = ...; port = 80;}]

One way would be making the listen option default to something based on
port if it was set by the user. which is the way to refer to the
config of that particular virtualHost because type = types.attrOf (..)
is used.

Is anybody else interested in such patch?

Marc Weber

Description: Binary data
nix-dev mailing list

Re: [Nix-dev] builtins.toPath returns ... a string?

2014-05-22 Thread Marc Weber
--eval-only --strict -xml output:


s = /home;
p = /home;
to_p = builtins.toPath /home;


  || ?xml version='1.0' encoding='utf-8'?
  || expr
  ||   attrs
  || attr column=3 line=3 name=p path=/tmp/test.nix
  ||   path value=/home /
  || /attr
  || attr column=3 line=2 name=s path=/tmp/test.nix
  ||   string value=/home /
  || /attr
  || attr column=3 line=4 name=to_p path=/tmp/test.nix
  ||   string value=/home /
  || /attr
  ||   /attrs
  || /expr

  /* Convert the argument to a path.  !!! obsolete? */
  static void prim_toPath(EvalState  state, const Pos  pos, Value * * args, 
Value  v)
  PathSet context;
  Path path = state.coerceToPath(pos, *args[0], context);
  mkString(v, canonPath(path), context);

You may want to talk about your use case.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Restructuring of the Wiki

2014-05-20 Thread Marc Weber
I'd say the summary of discussions like this belongs on a wiki :)
I'd keep as is unless there are strong reasons to switch.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Restructuring of the Wiki

2014-05-19 Thread Marc Weber
Just a very small comment:
Different wiki systems have been proposed earlier (when we ha da spam
problem). Two were important (to me):

1) (based on git), no login
  required (I haven't had any spam yet) - and if it happens it would be
  trivial to add non standard blockers

2) github's wiki

Both have one big advantage:
Because they can be managed via git they could be attached to nixpkgs
version or you could have them on disk and edit them with your favorite
text editor.

Eg you could grep nixpkgs and the wiki in one go to replace names and so

I do use the wiki to add content which probably should not be contained
in the manual so that I don't have to tell people twice.
Examples are: Introduction to hack-nix, how to find help, comparison of
'automatically updating sources' implementations and such.

While changing things can be done easily - I somehow still fail to see
which is the big problem you want to solve by your proposal.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] reading nix profile derivation priorities from manifest.nix

2014-05-03 Thread Marc Weber
Excerpts from Rommel Martinez's message of Sat May 03 09:46:00 + 2014:
 Let's presume that I have run the command 'nix-env --set-flag priority ...'
 many times and I have lost track of what they were, how can I reset
 them to the default state?

Following profile links to store, cp -L (dereferencing) them to /tmp and
running diff -r shows:

diff -r 11/manifest.nix 22/manifest.nix
 [ { meta = { }; name = nvi-1.79; out = { outPath = 
/nix/store/lcb2rbrhb183lbsxhk512d297ymv85j0-nvi-1.79; }; outPath = 
/nix/store/lcb2rbrhb183lbsxhk512d297ymv85j0-nvi-1.79; outputs = [ out ]; 
type = derivation; } ]
\ No newline at end of file
 [ { meta = { priority = 20; }; name = nvi-1.79; out = { outPath = 
 /nix/store/lcb2rbrhb183lbsxhk512d297ymv85j0-nvi-1.79; }; outPath = 
 /nix/store/lcb2rbrhb183lbsxhk512d297ymv85j0-nvi-1.79; outputs = [ out ]; 
 system = unknown; type = derivation; } ]
\ No newline at end of file

Thus read ~/.nix-profile/manifest.nix
How to change/reset? Does'nt look like nix-env provides a command (I
might have missed it again).

From buildenv.nix (nix distribution): (d.meta.priority or 5)
thus default priority is 5.

Now from nix-env:
   Print all of the meta-attributes of the derivation. This option is 
only available with --xml.

Thus I'd suggest:

nix-env -q --xml --meta

and there it is:

  ?xml version='1.0' encoding='utf-8'?
item attrPath=0 name=nvi-1.79 system=unknown
  meta name=priority type=string value=20 /

If you want to change something you at least have some pointers where/how to 
get started.

I've changed the subject hoping that its easier for google to find this
post in the future.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] How to actually get rid of things from the nix-env -qs list?

2014-04-28 Thread Marc Weber
Excerpts from Mateusz Kowalczyk's message of Mon Apr 28 10:39:11 + 2014:
 On 04/28/2014 09:23 AM, Marc Weber wrote:
 Is there a way to ask nix to tell me which one is active?
There is no active:yes/no


p-1.0:   /bin/foo
p-2.0:   /bin/foo-2.0

Then you'll have both in PATH

In yoru case I expect:

python-package-1.0:  lib/python-2.7/site-packages/
python-package-2.0:  lib/python-2.7/site-packages/

Thus if you link both the one which will be linked first should win.

How to find out?

follow the symlinks found in path 
to find out which one got linked.

But I agree, it might be helpful if there was not only a --set-flag prio
but also a --list-prios flag or such for nix-env, did I miss such?

No idea where those priorities get stored when set manually.

How to solve your problem? Don't use nix-env -i every single package,
instead you can use misc.collection

This illustrates one declarative approach to managing your custom
environment. It might make sense to have multiple collections such as
pythonPackages mailStuff etc.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] RFC: NixOS version string format

2014-04-27 Thread Marc Weber
We're using git, thus the only really meaningfull thing is the hash ..
But its hard to compare which is more or less up to date.

Thus maybe its worth thiking about adding the hash if it is not

The hash also identifies the history.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] User's configuration files

2014-04-26 Thread Marc Weber
Excerpts from Arseniy Seroka's message of Sat Apr 26 18:54:38 + 2014:
 Is it a good idea to create some option for a config file for a special
 user? I mean, for example, `users.extraUsers.userName.vimrc`. Or it's out
 of nixos idea?
If it works for you why not. About plugins: vim-pi is the project you
might want to get a list of packages definitions from to create nix
derivations eventually - however I won't spend much time on it due to
neovim becoming more popular soon eventually.

There are two ways:
  1) install .vimrc to /var/run/current-system/sw/vimrc/user.vim
  and source it in users .vimrc, then it'll be updated, and you can
  still have machine specific .vimrc lines

  (Thus install the .vimrc system wide, and make sure it gets installed
  to a user specific directory so that it doesn't collide with other
  user's vimrc (unlikely, cause you're managing your own machine) )

  2) override .vimrc .. which is a less nice eventually.

It all depends on what you do

Marc Weber
nix-dev mailing list

Re: [Nix-dev] My blog post on overrides in Nix

2014-04-22 Thread Marc Weber
Such content should be on the official wiki - then it can be updated

Marc Weber
nix-dev mailing list

Re: [Nix-dev] npm2nix maintainership

2014-04-17 Thread Marc Weber
Excerpts from Shea Levy's message of Thu Apr 17 02:16:24 + 2014:
 I wrote npm2nix, but I'm no longer doing any work with node stuff and
 would prefer to hand it off to someone who is using it and motivated to
 keep it up-to-date and working. Is there anyone who might want to take
 ownership of the project?

If you don't find anybody document current state on the wiki. Then it'll
be found easily again by people who want to use it.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] npm2nix maintainership

2014-04-17 Thread Marc Weber
Excerpts from Rob Vermaas's message of Thu Apr 17 14:14:22 + 2014:
 Oh wait, it's a mercurial repo, that won't work :)
Why not turn it into git?

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Nix language: converting an attribute set to a list

2014-04-14 Thread Marc Weber
attrValues (mapAttrs (name: vals: merge or check that name is same as name key) 
) attrs

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Hash Collisions

2014-04-08 Thread Marc Weber
Excerpts from Raahul Kumar's message of Tue Apr 08 03:11:03 + 2014:
 Thanks Marc, Kiril. Is there a way to create packages such that they don't
 provide redundant files? It's a waste of bandwidth to download a file,
 then be unable to use it because there is already a copy there. I guess
 deduplication is what I am looking for.
I'll give you another useful tip: If you want to save bandwidth then
switch to binary distro. While nixos has had the ability to create
binary differences I'm unsure wether its activated/available at the
moment. It was disabled in the past. Maybe somebody else can comment on

Also waste of space/bandwidth always happens because:

  - nixos always ships with header files for all libraries
(this could be fixed because nix supports multiple outputs)

  - if you replace coreutils you'll have to download everything, not
just coreutils

To sum up: You're talking about having some man files twice (which
should not take much space if they are compressed). Thus I don't think
the effort/value ratio is great if you start fixing things at that level
:( - We still use nixos because we think the values nixos provides
(atomic updates, deterministic distributed builds) are more important to

Anyway: Welcome to nixos :)

Marc Weber
nix-dev mailing list

Re: [Nix-dev] gnome 3 suport

2014-04-08 Thread Marc Weber
Hi Roelof, I have a deja vue,

Is it true that you asked this in 2011?

We have gnome expressions in nixpkgs, because gnome libraries are used
by some applications which compile and work (eg network manager or

I'm unsure about whether gnome desktop is supported now. I think its
still not (please correct me if I'm wrong). Thus try to clarify whether
you're talking about gnome libraries or the gnome desktop.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] versionedDeravation / php fpm / cups 1.7

2014-04-08 Thread Marc Weber
Excerpts from Domen Kožar's message of Mon Apr 07 17:31:58 + 2014:
 As soon as we allow more than one design pattern for sharing code between
package in my use cases means having same name and having most build
instructions be the same.

We do already have sharing for different systems, eg
src = if system = X then fetchurl else fetchurl ..

Eg eclipse case.

 I'm OK with versionedDerivation, if we come to consensus it's better than
 current approach and someone ports current codebase to use
That's not what I'm asking for: (rewriting code). The main request is:
Is it worth thinking that much about such small things if such patches
fix real world problems people might suffer from.
I want to achieve the goals with reasonably low effort - thus do what
works fastest. If we can imagine that this happens on this own - there
is no reason to fear that there is a maintenance burden - because if
there is one it'll be refactored (because contributors want to be done
fast, too)

 TL;DR: having more than one way to share code between packages 
Thus you'd vote for mkDerivation and being the only sensible
ways to share code ? :) Just trying to illustrate that its hard to
define what one labels as shared code.

 burden to maintenance
We should talk about specific cases, not about general things which
are hard to grasp.

Please keep in mind that you cannot prevent programmers from shooting
themselves into their feet - no matter what you do.

The question I'm asking is: Am I doing this is the cases I provided and
for what reason - and which kind of gun am I using (soft balls or

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Accidental force push to nixpkgs

2014-04-08 Thread Marc Weber

1) push to another repository which allows seting up hooks, then sync to

2) don't preven this when pushing, prevent when pulling by:

  git merge --ff-only or .git/config:

   When set to only, only such fast-forward merges are allowed (equivalent
   to giving the --ff-only option from the command line).

Using Google did not reveal more options to me.

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Maven support in nix

2014-04-07 Thread Marc Weber
Excerpts from shacka's message of Sun Apr 06 20:51:22 + 2014:
 is it possible to build maven project as nix package?
Not at all. Maven has its own dependency management, and nobody has
worked on porting this to nix (AFAIK).

Existing solutions (non Java):
- cabal2nix (cabal descriptions to nix)
- py2nix (or such) same for python
- ruby2nix (or such ) same for ruby

-hacknix/nixpkgs-ruby-overlay (they convert hackage/rubyforge to a pool
which gets translated to .nix files, derivations get created by
functions on the fly)

some time age there was announced some work /question about bundler
support (ruby)

Marc Weber
nix-dev mailing list

Re: [Nix-dev] Repo for incomplete/unmaintained work

2014-04-07 Thread Marc Weber
We've had some discussion, my proposal was:
Add a marker such as unmaintained-since: ...
then remove after 6 month or so. Due to the since you know exactly
what to remove.

The hard thing is to define what it means to be maintained or

Thus you could also introduce markers such as

  maintainance-levels = [ gets-updated-within-a-week-if-new-version-appears 
somebody is reviewing code ..];

Not sure whether it would make sense.

Whether such code gets moved to another repository or not - which is the
benefit/ difference from having a simple wiki page unmaintained
packages for nixos/ can be found in nixpkgs git history? Then at least
google finds it .. No idea.

Marc Weber
nix-dev mailing list

[Nix-dev] versionedDeravation / php fpm / cups 1.7

2014-04-07 Thread Marc Weber

In Eelco Dolstra described
what he dislikes:

  My main objection to versionedDerivation is the wackiness of
  having package functions that take the version as an argument,

  { stdenv, fetchurl, version ? 5.3 }:
  versionedDerivation cups version { ... }
  There is nothing about the function interface that tells you what
  the valid values of version are, and thus what versions are
  supported. What you should do is return an attribute set
  containing the supported versions:

  { stdenv, fetchurl }:
php_5_3 = ...;
php_5_4 = ...;
  Of course, you can factor out the commonality between versions any way 
you want, e.g.

makePHP = common: stdenv.mkDerivation ({ ... } // common);
  in {
php_5_3 = makePHP {
  name = php-5.3.50;
  src = fetchurl { ... };
  Alternatively, you can have separate files for each expression
  that include a file common.nix for the common stuff (like we do
  for the Linux kernel).


  I agree that it does make sense to docmuent which versions are
  The easy answer is:
  The default version is documented in the argument list, the others
  just mean can be build - or there has been a time where it did build
  unless they get referenced somewhere (most likely in all-packages.nix,
  see php5_3fpm example above. Whether this should be documented this way
  is another story.
  = I've created a new page:

  Documenting wich packages are how well supported is an open issue
  IMHO. This just is yet another way.

  The pattern Eelco Dolstra is discussing is used in different context
  and with some varation, eg in python-packages.nix:

  python-packages.nix takes as arguments:

{ pkgs, python, lowPrio }:

  Thus while its not taking a version, you still have no idea which
  python you may pass (or python versions ..) - thus IMHO its not that
  much differing :)

  A similar argument could be applied to systems. (eg darwin vs
  x86_64 i686):
  php.5.3.darwin to indicate its fine to be used on darwin.

  From this point of view there is not that much wrong by
  versionedDerivation, the only change neccessary would be making it
  return all versions as attrs so that such usage would be valid:

phps =import php/default.nix;
php_5_3 = import php/default.nix { }.5.3.x;
php_5_4 = import php/default.nix { }.5.4.x;

  Thus does it differ that much from [Example 3] above which looks like

php5_3fpm = php5_3.override { sapi = fpm; version = 5.3.x; };

  How would the perfect PHP nixpkgs implementation look like?

let commonConfigureFlagDescription = [ long list .. ];

let phpDerivation = { commonConfigureFlagDescription, version,
  src_md5_hash, patches ? [], allowFastCGI }: {
// the common code merging the options

mergexdebuglikestuff = php: php // {
  xdebug = ..
  acp = ..
  ... = ..;

phps = {
  php5_2 = mergexdebuglikestuff (phpDerivation {
long list of options
  php5_3 = mergexdebuglikestuff (phpDerivation {
  php5_4 = mergexdebuglikestuff (phpDerivation {
  php5_5 = mergexdebuglikestuff (phpDerivation {

   In the end is it that much more readable than what I already have?
   Link - [Example 3] PHP above

   I totally agree that I should refactor if newer versions happen to be
   totally different - it just didn't happen that way (yet) could be
   cause I've been lucky though.

Can you reply if you have new arguments about why versionedDeravation
is nice/bad so that we get a comprehensive list and that I understand
which is the best way to rewrite those patches ?

Also ping me if you're interested in testing either patch.

Thanks for helping me gain awarness .. :)

Marc Weber
nix-dev mailing list

  1   2   3   4   5   >