base/base.nix: set hostname in base module using nix opt

This commit is contained in:
2025-07-08 21:25:21 -07:00
parent 97fbd1f33e
commit 88c4e28a42

View File

@@ -1,5 +1,5 @@
# Module: base/base
{ config, lib, pkgs, ... }:
{ config, hostName, lib, pkgs, ... }:
with lib;
@@ -14,11 +14,20 @@ in {
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILiUy2yjIkdryH7pYMdkCNryy9gceqXJ7bhtMvvpPBIk etorres@xenon"
];
};
hostName = mkOption {
type = types.str;
default = "nixOS";
description = "System's hostname";
example = "server-01";
};
};
imports = [ ./grafana-alloy.nix ./network.nix ./qemu.nix ./spice.nix ];
config = {
networking.hostName = cfg.hostName;
time.timeZone = "Etc/UTC";
i18n.defaultLocale = "en_US.UTF-8";