niksos/modules/other/system.nix

39 lines
853 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
2024-07-25 11:45:44 +02:00
inherit (lib.options) mkOption;
2024-05-05 12:38:40 +02:00
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;
};
platform = mkOption {
description = "system (the one you usually passed to nixosSystem)";
type = str;
};
};
config = {
networking.hostName = cfg.hostname;
users.users.${cfg.username} = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
nixpkgs.hostPlatform = cfg.platform;
};
}