Re: [Nix-dev] some basic questions from a new NixOS user

2011-11-24 Thread Nicolas Pierron
Hi Linus,

On Thu, Nov 24, 2011 at 22:44, Linus Arver  wrote:
> On Thu, Nov 24, 2011 at 07:00:29PM +0100, Nicolas Pierron wrote:
>> Hi Linus,
>>
>> On Thu, Nov 24, 2011 at 07:24, Linus Arver  wrote:
>> > I'm new to this list.
>>
>> Great.
>>
>> > 1a. I've added a new user account with "useradd," per the manual, and
>> > have done a couple installations of software with `nix-env -i'. This is
>> > great, but I'm curious --- what is the preferred way to install
>> > software? The wiki page at http://nixos.org/wiki/Install/remove_software
>> > says that there are two ways to install software --- system-wide (by
>> > editing environment.systemPackages), and per-user (by just doing nix-env
>> > -i [package]). My understanding is that in order to get the advertised
>> > advantages of NixOS's rollback functionality, you have to do system-wide
>> > installs because the whole "nixos-rebuild" command only looks at
>> > /etc/nixos/configuration.nix. I.e., there is no way to rollback the
>> > system on a per-user basis. So, do most people on here have a very long
>> > environment.systemPackages definition in their configuration.nix,
>> > defining all system-wide packages?
>>
>> Using either per-user install or system-wide install depends on what
>> you want to do.  Personally I use both.
>>
>> NixOS is build on top of Nix and relies on the nix-env command to
>> update the system profile and also to do rollbacks (have a look at the
>> end of nix-env man page).  One advantage of per-user profiles is that
>> the root account does not see (in its default PATH) the user installed
>> software and also the opposite.  This difference is not a big security
>> protection but it helps to separate the administrative tools from the
>> commonly used tools.
>>
>> On my case, I am using user profiles to install software that I don't
>> want to see under the root user (inkscape, gimp, firefox, …) and I am
>> also using user-profiles (not the default ~/.nix-profile) to test
>> compilation with different tool-chains (x64-gcc45, x86-gcc46, …), in
>> which case I reset the environment and rebuild it from scratch with
>> only this user profile.
>>
>
> Thanks, this cleared up a lot of things. I just learned from reading the
> Nix manual that you can create new profiles by just doing
>
>    nix-env --switch-profile /nix/var/nix/profiles/foo
>
> and it will create "foo" if it doesn't exist already. I'm having trouble
> understanding the hierarchy of folders/files in the profiles folder,
> though. For my system, there appear to be 3 distinct profiles
>
>    1. /nix/var/nix/profiles/default (3 generations)
>    2. /nix/var/nix/profiles/system (7 generations)
>    3. /nix/var/nix/profiles/per-user/l/profile (11 generations)
>    4. /nix/var/nix/profiles/per-user/root (no files)
>
> I can tell that #3 is what I'm currently using (if I do "nix-env
> --list-generations" I get 11 generatios). If I do a "su" to change into
> root and then do "nix-env --list-generations" I get 3 generations, so
> that would correspond to #1. So my question is --- why does #4 exist? Is
> it to house new, custom-created profiles for the root user? Perhaps
> these different profiles should be documented in the Nix manual...

And easier way to find your current profile is to use

$ ls -l ~/.nix-profile

>> > 1b. If I wanted zsh, git, and rxvt-unicode to be available system-wide,
>> > can I do:
>> >
>> >    environment.systemPackages = [
>> >        pkgs.zsh
>> >        pkgs.git
>> >        pkgs.rxvt-unicode
>> >    ];
>> >
>> > in my configuration.nix? There does not seem to be any documentation
>> > regarding the syntax for this.
>>
>> Sure, you can do it, except that the papckages names are extracted
>> from /etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix .  Thus you
>> should not use the package name, but the key listed in this file.  So
>> you will need to replace
>>
>> >        pkgs.rxvt-unicode
>>
>> by    pkgs.rxvt_unicode
>>
>
> Thanks, that makes sense --- I was getting errors with the former form.
> Is the path
> "/etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix" documented
> somewhere so I can learn more about it?

Not directly, but multiple reference are made to it in Nixpkgs documentation.

http://nixos.org/nixpkgs/docs.html

>> > 2. If I do "nix-env -i" as the root user, then the installation is only
>> > for the root user, correct?
>>
>> I am no longer sure since I haven't reinstalled NixOS since a while,
>> but I think you have a default profile which is used by all users
>> including root.  So you may want to switch to another profile such as
>> $NIX_USER_PROFILE_DIR .
>
> I don't understand --- I thought switching profiles is done with the
> "nix-env --switch-profile" command?

It is, but you can manualy change to another profile if the current
link is not what you want.

> My original question was formulated
> when I did not have a good idea about profiles --- and maybe it doesn't
> make much sense in light of my discoveries above regarding
> /nix/v

Re: [Nix-dev] some basic questions from a new NixOS user

2011-11-24 Thread Linus Arver
On Thu, Nov 24, 2011 at 07:00:29PM +0100, Nicolas Pierron wrote:
> Hi Linus,
> 
> On Thu, Nov 24, 2011 at 07:24, Linus Arver  wrote:
> > I'm new to this list.
> 
> Great.
> 
> > 1a. I've added a new user account with "useradd," per the manual, and
> > have done a couple installations of software with `nix-env -i'. This is
> > great, but I'm curious --- what is the preferred way to install
> > software? The wiki page at http://nixos.org/wiki/Install/remove_software
> > says that there are two ways to install software --- system-wide (by
> > editing environment.systemPackages), and per-user (by just doing nix-env
> > -i [package]). My understanding is that in order to get the advertised
> > advantages of NixOS's rollback functionality, you have to do system-wide
> > installs because the whole "nixos-rebuild" command only looks at
> > /etc/nixos/configuration.nix. I.e., there is no way to rollback the
> > system on a per-user basis. So, do most people on here have a very long
> > environment.systemPackages definition in their configuration.nix,
> > defining all system-wide packages?
> 
> Using either per-user install or system-wide install depends on what
> you want to do.  Personally I use both.
> 
> NixOS is build on top of Nix and relies on the nix-env command to
> update the system profile and also to do rollbacks (have a look at the
> end of nix-env man page).  One advantage of per-user profiles is that
> the root account does not see (in its default PATH) the user installed
> software and also the opposite.  This difference is not a big security
> protection but it helps to separate the administrative tools from the
> commonly used tools.
> 
> On my case, I am using user profiles to install software that I don't
> want to see under the root user (inkscape, gimp, firefox, …) and I am
> also using user-profiles (not the default ~/.nix-profile) to test
> compilation with different tool-chains (x64-gcc45, x86-gcc46, …), in
> which case I reset the environment and rebuild it from scratch with
> only this user profile.
> 

Thanks, this cleared up a lot of things. I just learned from reading the
Nix manual that you can create new profiles by just doing

nix-env --switch-profile /nix/var/nix/profiles/foo

and it will create "foo" if it doesn't exist already. I'm having trouble
understanding the hierarchy of folders/files in the profiles folder,
though. For my system, there appear to be 3 distinct profiles

1. /nix/var/nix/profiles/default (3 generations)
2. /nix/var/nix/profiles/system (7 generations)
3. /nix/var/nix/profiles/per-user/l/profile (11 generations)
4. /nix/var/nix/profiles/per-user/root (no files)

I can tell that #3 is what I'm currently using (if I do "nix-env
--list-generations" I get 11 generatios). If I do a "su" to change into
root and then do "nix-env --list-generations" I get 3 generations, so
that would correspond to #1. So my question is --- why does #4 exist? Is
it to house new, custom-created profiles for the root user? Perhaps
these different profiles should be documented in the Nix manual...

> > 1b. If I wanted zsh, git, and rxvt-unicode to be available system-wide,
> > can I do:
> >
> >    environment.systemPackages = [
> >        pkgs.zsh
> >        pkgs.git
> >        pkgs.rxvt-unicode
> >    ];
> >
> > in my configuration.nix? There does not seem to be any documentation
> > regarding the syntax for this.
> 
> Sure, you can do it, except that the papckages names are extracted
> from /etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix .  Thus you
> should not use the package name, but the key listed in this file.  So
> you will need to replace
> 
> >pkgs.rxvt-unicode
> 
> bypkgs.rxvt_unicode
> 

Thanks, that makes sense --- I was getting errors with the former form.
Is the path
"/etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix" documented
somewhere so I can learn more about it?

> > 2. If I do "nix-env -i" as the root user, then the installation is only
> > for the root user, correct?
> 
> I am no longer sure since I haven't reinstalled NixOS since a while,
> but I think you have a default profile which is used by all users
> including root.  So you may want to switch to another profile such as
> $NIX_USER_PROFILE_DIR .

I don't understand --- I thought switching profiles is done with the
"nix-env --switch-profile" command? My original question was formulated
when I did not have a good idea about profiles --- and maybe it doesn't
make much sense in light of my discoveries above regarding
/nix/var/nix/profiles.

> Don't hesitate to give us your feedback if you think that some steps
> are not clear and took you time to figure out.  I'll update the wiki
> page to fix one mistake and to separate the uninstall from the
> removal.

Thanks! The biggest problem for me is the lack of practical
documentation --- right now the NixOS docs are concerned more about the
technical advantages of NixOS and do not really help actual users trying
out the system. Of cou

[Nix-dev] Can someone sychronize stdenv-updates with trunk?

2011-11-24 Thread roconnor
I was trying to merge trunk into stdenv-updates, but there is a comflict 
in gcc, so someone who knows what they are doing should resolve it.

-- 
Russell O'Connor  
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] some basic questions from a new NixOS user

2011-11-24 Thread Linus Arver
On Thu, Nov 24, 2011 at 08:21:25AM +0100, Marc Weber wrote:
> You're welcome.
> 
> > 1a. I've added a new user account with "useradd," per the manual, and
> 
> 3 ways: 
> 1) /var/run/current-system/sw/bin/ like installation by configuration.nix
> 2) system wide root installation ? (not sure about it)
> 3) user installation.
> 
> All can be rolled back. nix-env --list-generations etc (see man or do
> --help).

Ah, I did not know about "nix-env --list-generations". This is great!
I'll add a wiki entry about this.

> 
> > environment.systemPackages = [
> > pkgs.zsh
> > pkgs.git
> > pkgs.rxvt-unicode
> > ];
> Looks fine to me.
>  

Thanks.

-Linus
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-commits] SVN commit: nix - r30554 - nixpkgs/trunk/pkgs/top-level

2011-11-24 Thread Russell O'Connor
Author: roconnor
Date: Thu Nov 24 19:53:42 2011
New Revision: 30554
URL: https://nixos.org/websvn/nix/?rev=30554&sc=1

Log:
Forgot to add picosat to the all-packages.nix in revision 29869.  Now I'm 
adding it.

Modified:
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 19:48:20 
2011(r30553)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 19:53:42 
2011(r30554)
@@ -8244,6 +8244,8 @@
 
   opensmt = callPackage ../applications/science/logic/opensmt { };
 
+  picosat = callPackage ../applications/science/logic/picosat {};
+
   prover9 = callPackage ../applications/science/logic/prover9 { };
 
   satallax = callPackage ../applications/science/logic/satallax {};
___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


[Nix-commits] SVN commit: nix - r30553 - in nixpkgs/trunk/pkgs: applications/misc/bitcoin tools/networking/miniupnpc top-level

2011-11-24 Thread Russell O'Connor
Author: roconnor
Date: Thu Nov 24 19:48:20 2011
New Revision: 30553
URL: https://nixos.org/websvn/nix/?rev=30553&sc=1

Log:
Updating bitcoin to version 0.5.0.

Modified:
   nixpkgs/trunk/pkgs/applications/misc/bitcoin/default.nix
   nixpkgs/trunk/pkgs/tools/networking/miniupnpc/default.nix
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Modified: nixpkgs/trunk/pkgs/applications/misc/bitcoin/default.nix
==
--- nixpkgs/trunk/pkgs/applications/misc/bitcoin/default.nixThu Nov 24 
19:43:03 2011(r30552)
+++ nixpkgs/trunk/pkgs/applications/misc/bitcoin/default.nixThu Nov 24 
19:48:20 2011(r30553)
@@ -1,32 +1,30 @@
-{ fetchurl, stdenv, openssl, db4, boost, zlib, glib, libSM, gtk, wxGTK, 
miniupnpc }:
+{ fetchurl, stdenv, openssl, db4, boost, zlib, miniupnpc, qt4 }:
 
 stdenv.mkDerivation rec {
-  version = "0.3.24";
+  version = "0.5.0";
   name = "bitcoin-${version}";
 
   src = fetchurl {
-url = 
"mirror://sourceforge/project/bitcoin/Bitcoin/${name}/${name}-src.tar.gz";
-sha256 = "18n8i37c478b275m2x82411i1fsw8l34qm1k65ynnw38fpaj4h3r";
+url = " https://github.com/bitcoin/bitcoin/tarball/v${version}";;
+sha256 = "146q0ijvdmk9iidmavzkpdgflnfi86ahqkwdvxpf5gmfqdd53yqx";
   };
 
-  buildInputs = [ openssl db4 boost zlib glib libSM gtk wxGTK miniupnpc ];
+  buildInputs = [ openssl db4 boost zlib miniupnpc qt4 ];
 
-  preConfigure = ''
+  unpackCmd = "tar xvf $curSrc";
+
+  buildPhase = ''
+qmake
+make
 cd src
-substituteInPlace makefile.unix \
-  --replace "-Wl,-Bstatic" "" \
-  --replace "-Wl,-Bdynamic" "" \
-  --replace "DEBUGFLAGS=-g -D__WXDEBUG__" "DEBUGFLAGS=" \
+make -f makefile.unix
+cd ..
   '';
 
-  makefile = "makefile.unix";
-
-  buildFlags = "bitcoin bitcoind";
-
   installPhase = ''
 ensureDir $out/bin
-cp bitcoin $out/bin
-cp bitcoind $out/bin
+cp bitcoin-qt $out/bin
+cp src/bitcoind $out/bin
   '';
 
   meta = { 

Modified: nixpkgs/trunk/pkgs/tools/networking/miniupnpc/default.nix
==
--- nixpkgs/trunk/pkgs/tools/networking/miniupnpc/default.nix   Thu Nov 24 
19:43:03 2011(r30552)
+++ nixpkgs/trunk/pkgs/tools/networking/miniupnpc/default.nix   Thu Nov 24 
19:48:20 2011(r30553)
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "miniupnpc-1.5";
+  name = "miniupnpc-1.6";
 
   src = fetchurl {
 url = "http://miniupnp.free.fr/files/download.php?file=${name}.tar.gz";;
-sha256 = "0mx950lfxcjpsfny8qcjx6phb74v4zw1rlj99xicd4icx5j0w3s4";
+sha256 = "151rh46axl44y7bbflb43pnj52gvlfnkxfgrn2jvai5gwrbbgmmv";
   };
 
   installFlags = "PREFIX=$(out) INSTALLPREFIX=$(out)";

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 19:43:03 
2011(r30552)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 19:48:20 
2011(r30553)
@@ -6339,9 +6339,7 @@
 
   bitcoin = callPackage ../applications/misc/bitcoin {
 boost = boost144;
-wxGTK = wxGTK290;
-db4 = db47;
-inherit (xlibs) libSM;
+db4 = db48;
   };
 
   bitlbee = callPackage ../applications/networking/instant-messengers/bitlbee {
___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


[Nix-commits] SVN commit: nix - r30552 - in nixpkgs/trunk/pkgs: applications/science/logic/matita development/ocaml-modules/ulex/0.8 top-level

2011-11-24 Thread Russell O'Connor
Author: roconnor
Date: Thu Nov 24 19:43:03 2011
New Revision: 30552
URL: https://nixos.org/websvn/nix/?rev=30552&sc=1

Log:
adding camlp5 as a propogated build input to ulex 0.8

matita and ulex must build against the same version of camlp5, so in an attempt 
to force them to always be the same I am adding a propgatedBuildInput to ulex.
Granted Matita still requires camlp5_traditional and this is less obvious in 
the matita file now, so I am not entirely sure this is the right design choice.

Modified:
   nixpkgs/trunk/pkgs/applications/science/logic/matita/default.nix
   nixpkgs/trunk/pkgs/development/ocaml-modules/ulex/0.8/default.nix
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Modified: nixpkgs/trunk/pkgs/applications/science/logic/matita/default.nix
==
--- nixpkgs/trunk/pkgs/applications/science/logic/matita/default.nixThu Nov 
24 18:28:45 2011(r30551)
+++ nixpkgs/trunk/pkgs/applications/science/logic/matita/default.nixThu Nov 
24 19:43:03 2011(r30552)
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ocaml, camlp5, findlib, gdome2, ocaml_expat, gmetadom, 
ocaml_http, lablgtk, lablgtkmathview, ocaml_mysql, ocaml_sqlite3, ocamlnet, 
ulex08, camlzip, ocaml_pcre }:
+{stdenv, fetchurl, ocaml, findlib, gdome2, ocaml_expat, gmetadom, ocaml_http, 
lablgtk, lablgtkmathview, ocaml_mysql, ocaml_sqlite3, ocamlnet, ulex08, 
camlzip, ocaml_pcre }:
 
 let
   ocaml_version = (builtins.parseDrvName ocaml.name).version;
@@ -15,7 +15,7 @@
 sha256 = "04sxklfak71khy1f07ks5c6163jbpxv6fmaw03fx8gwwlvpmzglh";
   };
 
-  buildInputs = [ocaml camlp5 findlib gdome2 ocaml_expat gmetadom ocaml_http 
lablgtk lablgtkmathview ocaml_mysql ocaml_sqlite3 ocamlnet ulex08 camlzip 
ocaml_pcre ];
+  buildInputs = [ocaml findlib gdome2 ocaml_expat gmetadom ocaml_http lablgtk 
lablgtkmathview ocaml_mysql ocaml_sqlite3 ocamlnet ulex08 camlzip ocaml_pcre ];
 
   postPatch = ''
 BASH=$(type -tp bash)

Modified: nixpkgs/trunk/pkgs/development/ocaml-modules/ulex/0.8/default.nix
==
--- nixpkgs/trunk/pkgs/development/ocaml-modules/ulex/0.8/default.nix   Thu Nov 
24 18:28:45 2011(r30551)
+++ nixpkgs/trunk/pkgs/development/ocaml-modules/ulex/0.8/default.nix   Thu Nov 
24 19:43:03 2011(r30552)
@@ -21,6 +21,8 @@
 
   patches = [ ./meta_version.patch ./camlp5.patch ];
 
+  propagatedBuildInputs = [ camlp5 ];
+
   buildFlags = "all all.opt";
 
   meta = {

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 18:28:45 
2011(r30551)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 19:43:03 
2011(r30552)
@@ -8240,7 +8240,6 @@
   matita = callPackage ../applications/science/logic/matita {
 inherit (ocamlPackages) findlib lablgtk ocaml_expat gmetadom ocaml_http
 lablgtkmathview ocaml_mysql ocaml_sqlite3 ocamlnet ulex08 camlzip 
ocaml_pcre;
-camlp5 = ocamlPackages.camlp5_transitional;
   };
 
   minisat = callPackage ../applications/science/logic/minisat {};
___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


[Nix-commits] SVN commit: nix - r30551 - in nixos/trunk/modules: . services/system system/activation

2011-11-24 Thread Eelco Dolstra
Author: eelco
Date: Thu Nov 24 18:28:45 2011
New Revision: 30551
URL: https://nixos.org/websvn/nix/?rev=30551&sc=1

Log:
* Add a module for managing cgroups.

Added:
   nixos/trunk/modules/services/system/cgroups.nix
Modified:
   nixos/trunk/modules/module-list.nix
   nixos/trunk/modules/system/activation/activation-script.nix

Modified: nixos/trunk/modules/module-list.nix
==
--- nixos/trunk/modules/module-list.nix Thu Nov 24 18:14:28 2011(r30550)
+++ nixos/trunk/modules/module-list.nix Thu Nov 24 18:28:45 2011(r30551)
@@ -146,6 +146,7 @@
   ./services/scheduling/fcron.nix
   ./services/security/tor.nix
   ./services/security/torsocks.nix
+  ./services/system/cgroups.nix
   ./services/system/dbus.nix
   ./services/system/kerberos.nix
   ./services/system/nscd.nix

Added: nixos/trunk/modules/services/system/cgroups.nix
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixos/trunk/modules/services/system/cgroups.nix Thu Nov 24 18:28:45 
2011(r30551)
@@ -0,0 +1,140 @@
+{ config, pkgs, ... }:
+
+with pkgs.lib;
+
+let
+
+  cfg = config.services.cgroups;
+
+  cgconfigConf = pkgs.writeText "cgconfig.conf" cfg.groups;
+
+  cgrulesConf = pkgs.writeText "cgrules.conf" cfg.rules;
+
+in
+
+{
+
+  ## interface
+
+  options = {
+
+services.cgroups.enable = mkOption {
+  type = types.bool;
+  default = false;
+  description = ''
+Whether to enable support for control groups, a Linux kernel
+feature for resource management.  It allows you to assign
+processes to groups that share certain resource limits (e.g.,
+CPU or memory).  The cgrulesengd daemon
+automatically assigns processes to the right cgroup depending
+on the rules defined in
+services.cgroups.rules.
+  '';
+};
+
+services.cgroups.groups = mkOption {
+  type = types.string;
+  default =
+''
+  mount {
+cpu = /dev/cgroup/cpu;
+  }
+'';
+  example =
+''
+  mount {
+cpu = /dev/cgroup/cpu;
+cpuacct = /dev/cgroup/cpuacct;
+  }
+
+  # Create a "www" cgroup with a lower share of the CPU (the
+  # default is 1024).
+  group www {
+cpu {
+  cpu.shares = "500";
+}
+  }
+'';
+  description = ''
+The contents of the cgconfig.conf
+configuration file, which defines the cgroups.
+  '';
+};
+
+services.cgroups.rules = mkOption {
+  type = types.string;
+  default = "";
+  example =
+''
+  # All processes executed by the "wwwrun" uid should be
+  # assigned to the "www" CPU cgroup.
+  wwwrun cpu www
+'';
+  description = ''
+The contents of the cgrules.conf
+configuration file, which determines to which cgroups
+processes should be assigned by the
+cgrulesengd daemon.
+  '';
+};
+
+  };
+
+  
+  ## implementation
+
+  config = mkIf cfg.enable {
+
+environment.systemPackages = [ pkgs.libcgroup ];
+
+environment.etc =
+  [ { source = cgconfigConf;
+  target = "cgconfig.conf";
+}
+{ source = cgrulesConf;
+  target = "cgrules.conf";
+}
+  ];
+
+jobs.cgroups =
+  { startOn = "startup";
+
+description = "Control groups daemon";
+
+path = [ pkgs.libcgroup pkgs.procps ];
+  
+preStart =
+  ''
+# The daemon requires the userspace<->kernelspace netlink
+# connector.
+${config.system.sbin.modprobe}/sbin/modprobe cn || true
+  
+cgclear || true
+
+# Mount the cgroup hierarchies.  Note: we refer to the
+# store path of cgconfig.conf here to ensure that the job
+# gets reloaded if the configuration changes.
+cgconfigparser -l ${cgconfigConf}
+
+# Move existing processes to the right cgroup.
+cgclassify --cancel-sticky $(ps --no-headers -eL o tid) || true
+
+# Force a restart if the rules change:
+# ${cgrulesConf}
+  '';
+
+# Run the daemon that moves new processes to the right cgroup.
+exec = "cgrulesengd";
+
+daemonType = "fork";
+
+postStop =
+  ''
+cgclear
+  '';
+  };
+  
+
+  };
+
+}

Modified: nixos/trunk/modules/system/activation/activation-script.nix
==
--- nixos/trunk/modules/system/activation/activation-script.nix Thu Nov 24 
18:14:28 2011(r30550)
+++ nixos/trunk/modules/system/activation/activation-script.nix Thu Nov 24 
18:28:45 2011(r30551)
@@ -129,14 +129,6 @@
 m

[Nix-commits] SVN commit: nix - r30550 - nixpkgs/trunk/pkgs/os-specific/linux/nvidia-x11

2011-11-24 Thread Eelco Dolstra
Author: eelco
Date: Thu Nov 24 18:14:28 2011
New Revision: 30550
URL: https://nixos.org/websvn/nix/?rev=30550&sc=1

Log:
* NVIDIA driver updated to 290.10.

Modified:
   nixpkgs/trunk/pkgs/os-specific/linux/nvidia-x11/default.nix

Modified: nixpkgs/trunk/pkgs/os-specific/linux/nvidia-x11/default.nix
==
--- nixpkgs/trunk/pkgs/os-specific/linux/nvidia-x11/default.nix Thu Nov 24 
17:54:55 2011(r30549)
+++ nixpkgs/trunk/pkgs/os-specific/linux/nvidia-x11/default.nix Thu Nov 24 
18:14:28 2011(r30550)
@@ -7,7 +7,7 @@
 
 with stdenv.lib;
 
-let versionNumber = "285.05.09"; in
+let versionNumber = "290.10"; in
 
 stdenv.mkDerivation {
   name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) 
"-${kernel.version}"}";
@@ -18,12 +18,12 @@
 if stdenv.system == "i686-linux" then
   fetchurl {
 url = 
"http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run";;
-sha256 = "15kgsfpv0jigm1v3vnhcagni694lqm55kqysslmvb090nsczl0yf";
+sha256 = "1amdqmgi8rf8mafc5d8jnw6rk1bxrmxc5jm4wm2p8xqzm99qzglr";
   }
 else if stdenv.system == "x86_64-linux" then
   fetchurl {
 url = 
"http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run";;
-sha256 = "1zkgsjkhbx6dfmhhbflghbysr3icwfb5p6210xnhfss5dp2cvbwl";
+sha256 = "01d4cci1ipnamrxisdvsxjr6d4qbj257b46y0glm6grnw11i3x2g";
   }
 else throw "nvidia-x11 does not support platform ${stdenv.system}";
 
___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


Re: [Nix-dev] some basic questions from a new NixOS user

2011-11-24 Thread Nicolas Pierron
Hi Linus,

On Thu, Nov 24, 2011 at 07:24, Linus Arver  wrote:
> I'm new to this list.

Great.

> 1a. I've added a new user account with "useradd," per the manual, and
> have done a couple installations of software with `nix-env -i'. This is
> great, but I'm curious --- what is the preferred way to install
> software? The wiki page at http://nixos.org/wiki/Install/remove_software
> says that there are two ways to install software --- system-wide (by
> editing environment.systemPackages), and per-user (by just doing nix-env
> -i [package]). My understanding is that in order to get the advertised
> advantages of NixOS's rollback functionality, you have to do system-wide
> installs because the whole "nixos-rebuild" command only looks at
> /etc/nixos/configuration.nix. I.e., there is no way to rollback the
> system on a per-user basis. So, do most people on here have a very long
> environment.systemPackages definition in their configuration.nix,
> defining all system-wide packages?

Using either per-user install or system-wide install depends on what
you want to do.  Personally I use both.

NixOS is build on top of Nix and relies on the nix-env command to
update the system profile and also to do rollbacks (have a look at the
end of nix-env man page).  One advantage of per-user profiles is that
the root account does not see (in its default PATH) the user installed
software and also the opposite.  This difference is not a big security
protection but it helps to separate the administrative tools from the
commonly used tools.

On my case, I am using user profiles to install software that I don't
want to see under the root user (inkscape, gimp, firefox, …) and I am
also using user-profiles (not the default ~/.nix-profile) to test
compilation with different tool-chains (x64-gcc45, x86-gcc46, …), in
which case I reset the environment and rebuild it from scratch with
only this user profile.

> 1b. If I wanted zsh, git, and rxvt-unicode to be available system-wide,
> can I do:
>
>    environment.systemPackages = [
>        pkgs.zsh
>        pkgs.git
>        pkgs.rxvt-unicode
>    ];
>
> in my configuration.nix? There does not seem to be any documentation
> regarding the syntax for this.

Sure, you can do it, except that the papckages names are extracted
from /etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix .  Thus you
should not use the package name, but the key listed in this file.  So
you will need to replace

>pkgs.rxvt-unicode

bypkgs.rxvt_unicode

> 2. If I do "nix-env -i" as the root user, then the installation is only
> for the root user, correct?

I am no longer sure since I haven't reinstalled NixOS since a while,
but I think you have a default profile which is used by all users
including root.  So you may want to switch to another profile such as
$NIX_USER_PROFILE_DIR .


Don't hesitate to give us your feedback if you think that some steps
are not clear and took you time to figure out.  I'll update the wiki
page to fix one mistake and to separate the uninstall from the
removal.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


[Nix-commits] SVN commit: nix - r30549 - nixpkgs/trunk/pkgs/os-specific/linux/kernel

2011-11-24 Thread Eelco Dolstra
Author: eelco
Date: Thu Nov 24 17:54:55 2011
New Revision: 30549
URL: https://nixos.org/websvn/nix/?rev=30549&sc=1

Log:
* Enable PROC_EVENTS, since it's required by libcgroup's cgrulesengd
  to monitor process creation.

Modified:
   nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-2.6.35.nix
   nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.0.nix
   nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.1.nix
   nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.2.nix

Modified: nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-2.6.35.nix
==
--- nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-2.6.35.nixThu Nov 
24 14:22:13 2011(r30548)
+++ nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-2.6.35.nixThu Nov 
24 17:54:55 2011(r30549)
@@ -184,6 +184,11 @@
   # Allow up to 128 GiB of RAM in Xen domains.
   XEN_MAX_DOMAIN_MEMORY 128
 
+  # PROC_EVENTS requires that the netlink connector is not built
+  # as a module.  This is required by libcgroup's cgrulesengd.
+  CONNECTOR y
+  PROC_EVENTS y
+
   ${if kernelPlatform ? kernelExtraConfig then 
kernelPlatform.kernelExtraConfig else ""}
   ${extraConfig}
 '';

Modified: nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.0.nix
==
--- nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.0.nix   Thu Nov 24 
14:22:13 2011(r30548)
+++ nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.0.nix   Thu Nov 24 
17:54:55 2011(r30549)
@@ -197,6 +197,11 @@
   # they generally don't hurt.
   STAGING y
 
+  # PROC_EVENTS requires that the netlink connector is not built
+  # as a module.  This is required by libcgroup's cgrulesengd.
+  CONNECTOR y
+  PROC_EVENTS y
+
   ${if kernelPlatform ? kernelExtraConfig then 
kernelPlatform.kernelExtraConfig else ""}
   ${extraConfig}
 '';

Modified: nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.1.nix
==
--- nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.1.nix   Thu Nov 24 
14:22:13 2011(r30548)
+++ nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.1.nix   Thu Nov 24 
17:54:55 2011(r30549)
@@ -197,6 +197,11 @@
   # they generally don't hurt.
   STAGING y
 
+  # PROC_EVENTS requires that the netlink connector is not built
+  # as a module.  This is required by libcgroup's cgrulesengd.
+  CONNECTOR y
+  PROC_EVENTS y
+
   ${if kernelPlatform ? kernelExtraConfig then 
kernelPlatform.kernelExtraConfig else ""}
   ${extraConfig}
 '';

Modified: nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.2.nix
==
--- nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.2.nix   Thu Nov 24 
14:22:13 2011(r30548)
+++ nixpkgs/trunk/pkgs/os-specific/linux/kernel/linux-3.2.nix   Thu Nov 24 
17:54:55 2011(r30549)
@@ -196,6 +196,11 @@
   # they generally don't hurt.
   STAGING y
 
+  # PROC_EVENTS requires that the netlink connector is not built
+  # as a module.  This is required by libcgroup's cgrulesengd.
+  CONNECTOR y
+  PROC_EVENTS y
+
   ${if kernelPlatform ? kernelExtraConfig then 
kernelPlatform.kernelExtraConfig else ""}
   ${extraConfig}
 '';
___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


[Nix-commits] SVN commit: nix - r30548 - nixpkgs/trunk/pkgs/applications/networking/browsers/firefox

2011-11-24 Thread Eelco Dolstra
Author: eelco
Date: Thu Nov 24 14:22:13 2011
New Revision: 30548
URL: https://nixos.org/websvn/nix/?rev=30548&sc=1

Log:
* Fix incorrect URL.

Modified:
   nixpkgs/trunk/pkgs/applications/networking/browsers/firefox/8.0.nix

Modified: nixpkgs/trunk/pkgs/applications/networking/browsers/firefox/8.0.nix
==
--- nixpkgs/trunk/pkgs/applications/networking/browsers/firefox/8.0.nix Thu Nov 
24 13:48:16 2011(r30547)
+++ nixpkgs/trunk/pkgs/applications/networking/browsers/firefox/8.0.nix Thu Nov 
24 14:22:13 2011(r30548)
@@ -21,7 +21,7 @@
 
   
   src = fetchurl {
-url = 
"http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/${firefoxVersion}-candidates/build1/source/firefox-${firefoxVersion}.source.tar.bz2";;
+url = 
"http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";;
 sha1 = "0dd207c5cee9d53114c55aa23eeca36b754bc128";
   };
   
___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


[Nix-commits] SVN commit: nix - r30547 - in nixpkgs/trunk/pkgs: os-specific/linux/libcg os-specific/linux/libcgroup top-level

2011-11-24 Thread Eelco Dolstra
Author: eelco
Date: Thu Nov 24 13:48:16 2011
New Revision: 30547
URL: https://nixos.org/websvn/nix/?rev=30547&sc=1

Log:
* Move libcgroup from libcg/ to libcgroup/.

Added:
   nixpkgs/trunk/pkgs/os-specific/linux/libcgroup/
  - copied from r30546, nixpkgs/trunk/pkgs/os-specific/linux/libcg/
Deleted:
   nixpkgs/trunk/pkgs/os-specific/linux/libcg/
Modified:
   nixpkgs/trunk/pkgs/os-specific/linux/libcgroup/default.nix
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Modified: nixpkgs/trunk/pkgs/os-specific/linux/libcgroup/default.nix
==
--- nixpkgs/trunk/pkgs/os-specific/linux/libcg/default.nix  Thu Nov 24 
11:55:15 2011(r30546)
+++ nixpkgs/trunk/pkgs/os-specific/linux/libcgroup/default.nix  Thu Nov 24 
13:48:16 2011(r30547)
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pam, yacc, flex}:
+{ stdenv, fetchurl, pam, yacc, flex }:
 
 stdenv.mkDerivation rec {
   name = "libcgroup-0.37.1";
@@ -11,9 +11,10 @@
   buildInputs = [ pam ];
 
   buildNativeInputs = [ yacc flex ];
+  
   meta = {
-description = "library that abstracts the control group file system in 
Linux";
-homepage = "http://libcg.sourceforge.net";;
+description = "Library and tools to manage Linux's cgroup resource 
management system";
+homepage = http://libcg.sourceforge.net/;
 license = "LGPL";
 platforms = stdenv.lib.platforms.linux;
   };

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 11:55:15 
2011(r30546)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 13:48:16 
2011(r30547)
@@ -5261,7 +5261,7 @@
 
   libatasmart = callPackage ../os-specific/linux/libatasmart { };
 
-  libcgroup = callPackage ../os-specific/linux/libcg { };
+  libcgroup = callPackage ../os-specific/linux/libcgroup { };
 
   libnl = callPackage ../os-specific/linux/libnl { };
 
___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


[Nix-commits] SVN commit: nix - r30546 - in nixpkgs/trunk/pkgs: applications/networking/browsers/firefox top-level

2011-11-24 Thread Eelco Dolstra
Author: eelco
Date: Thu Nov 24 11:55:15 2011
New Revision: 30546
URL: https://nixos.org/websvn/nix/?rev=30546&sc=1

Log:
* Firefox 8.0.1.
* Make Firefox 8 the default.

Modified:
   nixpkgs/trunk/pkgs/applications/networking/browsers/firefox/8.0.nix
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Modified: nixpkgs/trunk/pkgs/applications/networking/browsers/firefox/8.0.nix
==
--- nixpkgs/trunk/pkgs/applications/networking/browsers/firefox/8.0.nix Wed Nov 
23 16:15:33 2011(r30545)
+++ nixpkgs/trunk/pkgs/applications/networking/browsers/firefox/8.0.nix Thu Nov 
24 11:55:15 2011(r30546)
@@ -15,14 +15,14 @@
 
 rec {
 
-  firefoxVersion = "8.0";
+  firefoxVersion = "8.0.1";
   
-  xulVersion = "8.0"; # this attribute is used by other packages
+  xulVersion = "8.0.1"; # this attribute is used by other packages
 
   
   src = fetchurl {
 url = 
"http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/${firefoxVersion}-candidates/build1/source/firefox-${firefoxVersion}.source.tar.bz2";;
-sha1 = "843cf4ad70d2fc4b16654c3ff9b080d3eb357452";
+sha1 = "0dd207c5cee9d53114c55aa23eeca36b754bc128";
   };
   
   commonConfigureFlags =

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix   Wed Nov 23 16:15:33 
2011(r30545)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix   Thu Nov 24 11:55:15 
2011(r30546)
@@ -6645,7 +6645,7 @@
 
   firefoxWrapper = wrapFirefox { browser = pkgs.firefox; };
 
-  firefoxPkgs = pkgs.firefox70Pkgs;
+  firefoxPkgs = pkgs.firefox80Pkgs;
 
   firefox36Pkgs = callPackage 
../applications/networking/browsers/firefox/3.6.nix {
 inherit (gtkLibs) gtk pango;
___
nix-commits mailing list
nix-comm...@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-commits


Re: [Nix-dev] [Nix-commits] SVN commit: nix - r30466 - nix/trunk

2011-11-24 Thread Ludovic Courtès
Hi,

Eelco Dolstra  skribis:

> On 11/19/2011 11:36 PM, Ludovic Courtès wrote:
>
>> Out of curiosity, where did you get “amd64”?  GNU config.guess always
>> returns “x86_64”:
>> .
>
> Apparently not on FreeBSD:
>
> [nix@beastie ~/nix-1.0pre30457]$ ./config/config.guess
> amd64-unknown-freebsd8.2

I have:

--8<---cut here---start->8---
$ uname -sm
FreeBSD amd64
$ ~/src/nix-1.0pre30543/config/config.guess 
x86_64-unknown-freebsd8.2
$ ~/src/nix-1.0pre30543/config/config.guess --version | head -1
GNU config.guess (2009-11-20)
--8<---cut here---end--->8---

Could it be that you used a patched config.guess as shipped by the
Automake package on FreeBSD (for instance because you ran autoreconf on
the FreeBSD host)?

Thanks,
Ludo’.

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev