[Nix-dev] beeing new to nix - Hello various questions

Eelco Dolstra eelco at cs.uu.nl
Tue Mar 13 12:22:19 CET 2007


Hi Marc,

Marc Weber wrote:

> How do you think about windows support?
> Distributing something like cygwin this way would be really nice.

We do have Windows support.  Nix currently builds on Cygwin.  The standard
environment on Windows by default builds Cygwin binaries, but Martin made
another stdenv (i686-mingw) that builds Mingw binaries.  It's also possible to
build "native" Windows packages.  In fact we have the Microsoft Visual C++
Express Edition and the Windows SDK in Nixpkgs :-)

> Where can I find the repositories containing all build instructions?

The Nix expressions and build scripts for Nixpkgs are here:

  https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/trunk/

In addition, the NixOS specific stuff is in

  https://svn.cs.uu.nl:12443/repos/trace/nixos/trunk/

> I'd like to add wmii which is a really great small window manager.

That would go into
https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/trunk/pkgs/applications/window-managers/.

> Is there already a strategy for installing more than one version of some package?
> Something like java-config of gentoo?

Right now this doesn't work very well, since installing two versions on the same
package into the same profile gives a filename collision.  You can however
install different versions in different profiles, e.g.

  $ nix-env -p /nix/var/nix/profiles/old-gcc -i gcc-3.3.6
  $ nix-env -i gcc-4.1.1 # goes into the default profile

Better support for multiple versions in the same profile should appear soon (see
https://bugs.cs.uu.nl/browse/NIX-80).

> When writing small scripts (bash /perl / python ...) and using the shabeng line:
> Would it make sense to also support env (which might select the lates availible version)
> Or do I need to package them and reinstall because I have another bash version
> (which isn't that expensive when using the serialized binary updates..)

Under NixOS at least it might be useful to have something like "env", since for
scripts outside of the Nix store you don't want to specify a full path to the
interpreter in the Nix store (that would be very fragile).

For packages that are built by Nix it's not a problem; the builder is supposed
to make sure that every #! points to the full path of the interpreter in the Nix
store, so the interpreter (e.g., Perl) should be passed as a build-time
dependency to that package.

> The bootable CD does contain two files I noticed:
> ./nix/store/wxjsylln5fcmk196mzpv6nfgz22866ak-stdenv-linux/setup:PATH=$_PATH${_PATH:+:}$PATH
> ./nix/store/xbs5wiwils6s6lxq773x0mg4ynav2q27-activate-configuration.sh:for i in /nix/store/kwfbggmibkx6i3jh8y4vrnrb0s176gz7-coreutils-6.7 /nix/store/4gqrgld23zm9bsas9h4xi3bs9q8vjn61-gnugrep-2.5.1a /nix/store/mjac8mvkd9jnhavpx7bxs71h2026hsh0-findutils-4.2.29 /nix/store/im276akmsrhvgh9hmbxmcwrsifmbsh2g-glibc-2.5 /nix/store/glgy0651jjdgnqb9hx8arcbzv48yrd8n-pwdutils-3.1.3; do PATH=$PATH:$i/bin:$i/sbin; done
> Are these the files beeing sourced on startup to set environment variables?

stdenv-linux/setup is a build-time script which isn't used at boot time (but
stdenv is included on the CD to speed up building; otherwise it would have to be
downloaded).  activate-configuration.sh sets some temporary PATH for booting,
but the real PATH for logins shells and the like is set here:

  https://svn.cs.uu.nl:12443/repos/trace/nixos/trunk/system/etc/profile.sh

where @systemPath@ is substituted from the list of "system packages"
(systemPathList) in

  https://svn.cs.uu.nl:12443/repos/trace/nixos/trunk/system/system.nix

-- 
Eelco Dolstra | http://www.cs.uu.nl/~eelco



More information about the nix-dev mailing list