39 lines
985 B
Nix
39 lines
985 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.homelab.users.admin;
|
|
in {
|
|
options.homelab.users.admin = {
|
|
enable = lib.mkEnableOption "user System Administrator";
|
|
authorizedKeys = lib.mkOption {
|
|
type = lib.types.listOf lib.types.str;
|
|
default = [
|
|
# HomeLab > NixOS > admin > ssh
|
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIHOoTp+e6qWGn4Sco5CZ6G0zrX5NAQBpLlDVirncJ/HqAAAABHNzaDo="
|
|
];
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
nix.settings.trusted-users = [
|
|
config.users.users.gh0st.name
|
|
];
|
|
|
|
users.users.gh0st = {
|
|
description = "System Administrator";
|
|
isNormalUser = true;
|
|
extraGroups = [
|
|
config.users.groups.wheel.name # Enable 'sudo' for the user.
|
|
];
|
|
initialPassword = "ChangeMe";
|
|
openssh.authorizedKeys.keys = cfg.authorizedKeys;
|
|
packages = with pkgs; [
|
|
curl
|
|
git
|
|
tmux
|
|
vim
|
|
wget
|
|
];
|
|
};
|
|
};
|
|
}
|