2021-02-06 15:35:38 +01:00
|
|
|
|
# User setup
|
2021-02-19 19:48:35 +01:00
|
|
|
|
{ config, pkgs, ... }:
|
2021-02-06 15:35:38 +01:00
|
|
|
|
let
|
|
|
|
|
my = config.my;
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
users.mutableUsers = false; # I want it to be declarative.
|
|
|
|
|
|
|
|
|
|
# Define user accounts and passwords.
|
|
|
|
|
users.users.root.hashedPassword = my.secrets.users.root.hashedPassword;
|
|
|
|
|
users.users.ambroisie = {
|
|
|
|
|
hashedPassword = my.secrets.users.ambroisie.hashedPassword;
|
|
|
|
|
description = "Bruno BELANYI";
|
|
|
|
|
isNormalUser = true;
|
2021-02-19 19:48:35 +01:00
|
|
|
|
shell = pkgs.zsh;
|
2021-02-06 15:35:38 +01:00
|
|
|
|
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
|
|
|
|
openssh.authorizedKeys.keys = with builtins; let
|
2021-02-15 23:40:39 +01:00
|
|
|
|
keyDir = ./ssh;
|
2021-02-06 15:35:38 +01:00
|
|
|
|
contents = readDir keyDir;
|
|
|
|
|
names = attrNames contents;
|
|
|
|
|
files = filter (name: contents.${name} == "regular") names;
|
|
|
|
|
keys = map (basename: readFile (keyDir + "/${basename}")) files;
|
|
|
|
|
in
|
|
|
|
|
keys;
|
|
|
|
|
};
|
|
|
|
|
}
|