niksos/modules/other/system.nix

32 lines
653 B
Nix
Raw Normal View History

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