62 lines
1.4 KiB
Nix
62 lines
1.4 KiB
Nix
# User config definitions
|
||
{
|
||
config,
|
||
pkgs,
|
||
lib,
|
||
...
|
||
}:
|
||
with lib; let
|
||
cfg = config.calliope;
|
||
in {
|
||
options.calliope = {
|
||
hostname = mkOption {
|
||
type = types.str;
|
||
default = "calliope";
|
||
};
|
||
ipv4Address = mkOption {
|
||
type = types.str;
|
||
};
|
||
name = mkOption {
|
||
type = types.str;
|
||
};
|
||
cec = mkOption {
|
||
type = types.str;
|
||
};
|
||
username = mkOption {
|
||
type = types.str;
|
||
};
|
||
shell = mkOption {
|
||
default = pkgs.zsh;
|
||
type = types.package;
|
||
};
|
||
authorizedKeys = mkOption {
|
||
type = types.listOf types.singleLineStr;
|
||
default = [];
|
||
};
|
||
|
||
# TODO:
|
||
sshIdentities = mkOption {};
|
||
};
|
||
|
||
config = {
|
||
calliope.username = lib.mkDefault cfg.cec;
|
||
networking.hostName = cfg.hostname;
|
||
|
||
# Enable automatic login for the user.
|
||
services.getty.autologinUser = lib.mkDefault cfg.username;
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users."${cfg.username}" = {
|
||
isNormalUser = true;
|
||
description = cfg.name;
|
||
initialPassword = "C!sc0!@#";
|
||
shell = cfg.shell;
|
||
extraGroups = ["networkmanager" "wheel"];
|
||
openssh.authorizedKeys.keys = cfg.authorizedKeys;
|
||
};
|
||
# TODO: set the ipv4 address, and figure out how to set this without knowing interface name
|
||
# TODO: set default gateway
|
||
# TODO: use CEC to set up git identity
|
||
# TODO: set SSH Private keys
|
||
};
|
||
}
|