[Nix-dev] [PATCH] authorized_keys in users.extraUsers

Rickard Nilsson rickard.nilsson at telia.com
Thu Oct 20 00:11:44 CEST 2011


Hi Nicolas,

Den 2011-10-19 01:21:02 skrev Nicolas Pierron  
<nicolas.b.pierron at gmail.com>:

> Hi Rickard,
>
> On Tue, Oct 18, 2011 at 00:40, Rickard Nilsson
> <rickard.nilsson at telia.com> wrote:
>
> This is the way to proceed, may be the error messages are not
> extremelly explicit about the corner cases.  Not many users end-up
> working with such (nice) features of the NixOS module system.  I am
> happy to see that you are going into the right way with a few examples
> :)
>
>>    users = mkOption {
>>      default = {};
>>      description = ''
>>      '';
>>      type = types.loaOf types.optionSet;
>>      options = [ usersOptions ];
>>    };
>>
>> However, this made Nix complain about types. If I renamed "users" to
>> something that isn't already defined it worked fine though.
>
> You should not redefine the type, default and the description.  Such
> things are only accepted once per option declarations.
>
> The following should work, any changes of the type should be done in
> the original declaration.
>
>    users = mkOption {
>      options = [ usersOptions ];
>    };

I see, that makes sense. Thinking about it, I probably can't put the
configuration in users.<name?>.xx anyway, since it will collide with
a lot of other stuff (like users.ldap.xx for example). Would it make
sense to put it in user.<name?>.openssh.xx instead?
Or is "user" and "users" too easy to mix up?


   / Rickard


More information about the nix-dev mailing list