Skip to content

Instantly share code, notes, and snippets.

Created January 31, 2018 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/40c8953d04cd3f589189ff5ec6afd0aa to your computer and use it in GitHub Desktop.
Save anonymous/40c8953d04cd3f589189ff5ec6afd0aa to your computer and use it in GitHub Desktop.
{
users.extraUsers =
let mkUser = desc: { isNormalUser = true; description = desc; };
in
{
foo = mkUser "foo";
};
users.extraUsers.root.openssh.authorizedKeys.keys = [ "bar" ];
}
/*
/tmp ❯❯❯ nix-instantiate --eval let-bizzare-bad.nix
error: attribute ‘users.extraUsers.root.openssh.authorizedKeys.keys’ at /private/tmp/let-bizzare-bad.nix:8:3 already defined at /private/tmp/let-bizzare-bad.nix:2:3
*/
let mkUser = desc: { isNormalUser = true; description = desc; };
in
{
users.extraUsers = {
foo = mkUser "foo";
};
users.extraUsers.root.openssh.authorizedKeys.keys = [ "bar" ];
}
/*
/tmp ❯❯❯ nix-instantiate --eval let-bizzare-good.nix ✘ 1
{ users = <CODE>; }
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment