niksos/modules/other/system.nix
2024-08-06 17:46:57 +02:00

38 lines
841 B
Nix

{
config,
lib,
...
}: let
cfg = config.poz.other.system;
inherit (lib.options) mkOption;
inherit (lib.types) str;
in {
options.poz.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;
};
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;
};
}