[Nix-dev] /etc/skel, useradd - resolve symlinks before copying?

Marc Weber marco-oweber at gmx.de
Sat Feb 12 16:10:26 CET 2011


Sometimes I create an SSH account for customers to create web previews.
Most of them don't even know bash. So I want my defaults to be available
everywhere without additional efforts - "Do it once".

I konw that some people hate defaults. So opting out by putting
your own contents into ~/.bashrc seems to be the perfect way.

In my patch /etc/bashrc *only* sets up PATH - because this is special
about nixos - and without PATH you can't work.

I moved all the colored ls alias stuff etc into
/etc/bash-user-system-default.sh and make the ~/.bashrc source it.

This way its always up to date if nobody cared about it.

Its no only about ~/.bashrc. Its also about ~/.vimrc. Touching it is
enough to force "nocompatbile" mode which is the mode you want to work
in - because without it ever :e fil<tab> completion doesn't work.

Again: I want users being able to change the default - without having to
remove the symlink first.

The real question is: Patch the /etc builder script and make it have
some additional bookkeeping or patch useradd.

Patching useradd seems to be the cleaner solution to me so that's what
I'm going to do.

Its not much what I want: only git completion and a faster cd command.

That's what I'm putting into my new nixos configuration option called
interactiveShellInit

If you think about it you're very likely to find some use cases for
additional commands you want to support system wide.

Marc Weber



More information about the nix-dev mailing list