Re: [Nix-dev] NixOS on a machine with only one user

2015-04-25 Thread Matthias Beyer
On 25-04-2015 17:00:18, Kosyrev Serge wrote:
 
 My only pain is that the various ~/.* folders and files don't quite fit
 into this..  otherwise it'd be pure bliss.
 

What do you mean by this?

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Proudly sent with mutt.
Happily signed with gnupg.


pgpzQ3dJrKjDS.pgp
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] NixOS on a machine with only one user

2015-04-25 Thread Matthias Beyer
On 24-04-2015 20:07:49, Arseniy Seroka wrote:
 Do as you will.
 I keep my system profile as minimal as I can.

I do the exact opposite: I put almost everything into the system
packages.

Why:

I have several machines (currently only one on NixOS, actively used,
another one not used by now). I have the configuration.nix split into
several files and put everything under version control. I have several
sets of packages (base, gaming, development, media, etc) and I have
one main file for each host. This way I can do DRY. I put a new
package in, say, developPackages.nix and all new machines get it after
a short git pull  nixos-rebuild switch.

If someone wants to know more: http://beyermatthias.de/tags/nixos.html

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Proudly sent with mutt.
Happily signed with gnupg.


pgpLMVEZ3YSOJ.pgp
Description: PGP signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] NixOS on a machine with only one user

2015-04-25 Thread Ertugrul Söylemez
  Assuming bigger things usually gives you a better or at least more
  scalable result, and in most cases the additional cost is very close
  to zero. For example every single-disk system I set up uses a
  two-disk RAID array with one missing disk from the point of view of
  mdadm. If it does happen that I actually want to add more disks, it
  will be a few short online commands to do it instead of a tedious
  reinstallation of the entire system, and it costs only a few
  megabytes. The additional disk might as well be an external
  emergency disk that starts synchronising as soon as I plug it in.

 How did you manage to make mdadm do that?

It allows you to create arrays with missing disks, and you can activate
them as long as enough disks are present.  It's like creating an array
with a failed disk right from the beginning:

mdadm --create /dev/md/blah-system \
-l 1 -n 2 \
/dev/sda2 missing

Notice the `missing` argument.  It tells mdadm that the first disk is
`/dev/sda2` and the second disk is currently missing.  When you plug in
a second disk, just add it to the array.  When you plug in a third disk,
convert the array to RAID5 (can be done online in the background, see
`--grow`) and add the third disk.  And so on.


Greets,
Ertugrul


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


Re: [Nix-dev] NixOS on a machine with only one user

2015-04-24 Thread Ertugrul Söylemez
 NixOS noob here. I'm using NixOS on a machine with only one user (me).
 What's the best strategy for installing packages?
 [...]
 Installing into a normal user profile

In general I tend to just assume that my system is an actual multi-user
system.  I'm a normal user, so I don't make any assumptions on the way
imaginary fellow users use their account.  A very small number of
packages will have to be used by the majority of the users on the
system, for example because they are relevant to the network topology or
purpose.  Most of them will be installed in the form of NixOS services.
All other packages are user-specific.

Installing user packages into the user profile has the additional
advantage that it is safe and secure to install your own packages, which
you may want to do from time to time, perhaps because you may want to
use Nixpkgs-master for some bleeding edge version or because you may
want to use Nix for a custom package or development.  Remember that Nix
handles not only code.  You can equally well write and deploy a bunch of
static files using it.

Assuming bigger things usually gives you a better or at least more
scalable result, and in most cases the additional cost is very close to
zero.  For example every single-disk system I set up uses a two-disk
RAID array with one missing disk from the point of view of mdadm.  If it
does happen that I actually want to add more disks, it will be a few
short online commands to do it instead of a tedious reinstallation of
the entire system, and it costs only a few megabytes.  The additional
disk might as well be an external emergency disk that starts
synchronising as soon as I plug it in.

Fortunately this is possible with NixOS.  Many distributions, including
all Anaconda-based ones (RHEL, CentOS, Fedora, etc.), do not allow you
to do this.


Greets,
Ertugrul


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


Re: [Nix-dev] NixOS on a machine with only one user

2015-04-24 Thread Arseniy Seroka
Do as you will.
I keep my system profile as minimal as I can.
And my user profile consists of several groups of pkgs.
I have them in my ~/.nixpkgs/config [1].
Firstly I just install via `nix-env -i`, if I like the pkgs and I need it
I'm writing it into my [1] to one of the groups (env).

[1] https://github.com/jagajaga/my_configs/blob/master/.nixpkgs/common.nix
(~/.nixpkgs/config is linked to this file).

2015-04-24 19:23 GMT+03:00 Amy de Buitléir a...@nualeargais.ie:

 NixOS noob here. I'm using NixOS on a machine with only one user (me).
 What's the best strategy for installing packages?

 Installing into the global system environment
 - or -
 Installing into a normal user profile

 It seems that the second method would be a bit more convenient, especially
 if I add and remove new software frequently. Which I do.

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




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


Re: [Nix-dev] NixOS on a machine with only one user

2015-04-24 Thread Linus Arver
On Fri, Apr 24, 2015 at 04:23:39PM +, Amy de Buitléir wrote:
 NixOS noob here. I'm using NixOS on a machine with only one user (me).
 What's the best strategy for installing packages?
 
 Installing into the global system environment
 - or -
 Installing into a normal user profile 
 
 It seems that the second method would be a bit more convenient, especially
 if I add and remove new software frequently. Which I do.

Hi Amy,

I also use NixOS on machines where I am the sole user. I try out
packages in the normal user profile first with `nix-env -i` and then if
I end up sticking with it, move it into the global system environment in
`/etc/nixos/configuration.nix`. I try to keep my user profile minimal or
empty.

I am also very new to NixOS, but the above method seems to work well. I
keep track of the system configuration with git, so that's a nice added
bonus.

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


Re: [Nix-dev] NixOS on a machine with only one user

2015-04-24 Thread phreedom
On Friday, April 24, 2015 16:23:39 Amy de Buitléir wrote:
 NixOS noob here. I'm using NixOS on a machine with only one user (me).
 What's the best strategy for installing packages?
 
 Installing into the global system environment
 - or -
 Installing into a normal user profile

- or -
Installing using nix-shell -p.

This is what I use to install simple packages such as cli tools. More often 
than not, I end up not using that utility for more than the current task, so 
it's very convenient for the software to disappear once you close the shell. 
If you use something often enough to get tired of pulling it in via nix-shell, 
then maybe it's worth installing permanently.
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev