automatically set host name

This commit is contained in:
Pim Kunis 2024-01-28 14:08:28 +01:00
parent 0fd0713e08
commit 45b7cd5c6c
3 changed files with 8 additions and 13 deletions

View file

@ -74,7 +74,10 @@
nixosConfigurations = mkNixosSystems (name: machine: {
inherit system;
specialArgs = { inherit machines machine kubenix dns microvm disko agenix; };
modules = [ ./nixos ];
modules = [
./nixos
{ networking.hostName = name; }
];
});
deploy = {

View file

@ -3,8 +3,6 @@
type = "physical";
nixosModule = {
networking.hostName = "jefke";
lab = {
terraformDatabase.enable = true;
@ -29,8 +27,6 @@
nixosModule = { config, ... }:
let inherit (config.lab.networking) dmzServicesIPv4 dmzServicesIPv6; in
{
networking.hostName = "atlas";
lab = {
networking = {
# TODO: Ideally, we don't have to set this here.
@ -57,8 +53,6 @@
type = "physical";
nixosModule = {
networking.hostName = "lewis";
lab = {
dataHost.enable = true;
@ -81,7 +75,6 @@
hypervisorName = "lewis";
nixosModule = { pkgs, ... }: {
networking.hostName = "my-microvm";
lab.vmMacAddress = "BA:DB:EE:F0:00:00";
programs.bash.interactiveShellInit = ''

View file

@ -65,11 +65,10 @@
{
# TODO Simplify?
specialArgs = { inherit agenix disko pkgs lib microvm; machine = vm; hypervisorConfig = config; };
config = {
imports = [
./.
];
};
config.imports = [
./.
{ networking.hostName = name; }
];
}
)
vmsForHypervisor;