diff --git a/hosts/test/configuration.nix b/hosts/test/configuration.nix index 2939e2a..10199da 100644 --- a/hosts/test/configuration.nix +++ b/hosts/test/configuration.nix @@ -11,7 +11,9 @@ ]; homelab = { + core = { + hostname = "test"; kernel = "lts"; }; diff --git a/modules/core/config.nix b/modules/core/config.nix index 81fe41e..4c3c4b1 100644 --- a/modules/core/config.nix +++ b/modules/core/config.nix @@ -9,8 +9,9 @@ let allowRootSSH = if cfg.ssh.permitRootLogin then "yes" else "no"; in { - config = { + networking.hostName = cfg.hostname; + boot = { kernelPackages = shared.kernelOptions.${cfg.kernel}; loader = { diff --git a/modules/core/options.nix b/modules/core/options.nix index 6f74ed8..2767440 100644 --- a/modules/core/options.nix +++ b/modules/core/options.nix @@ -5,6 +5,12 @@ }: { options.homelab.core = { + hostname = lib.mkOption { + type = lib.types.str; + default = "nixos"; + description = "Hostname of the machine"; + }; + kernel = lib.mkOption { type = with lib.types; enum (builtins.attrNames shared.kernelOptions); default = "lts";