niksos/modules/other/system.nix

31 lines
653 B
Nix

{
config,
lib,
...
}: let
cfg = config.myOptions.other.system;
inherit (lib) mkOption;
inherit (lib.types) str;
in {
options.myOptions.other.system = {
hostname = mkOption {
description = "hostname for this system";
type = str;
};
username = mkOption {
description = "username for this system (doesn't support multi user yet)";
type = str;
};
};
config = {
networking.hostName = cfg.hostname;
users.users.${cfg.username} = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
};
}