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: { nixosConfigurations = mkNixosSystems (name: machine: {
inherit system; inherit system;
specialArgs = { inherit machines machine kubenix dns microvm disko agenix; }; specialArgs = { inherit machines machine kubenix dns microvm disko agenix; };
modules = [ ./nixos ]; modules = [
./nixos
{ networking.hostName = name; }
];
}); });
deploy = { deploy = {

View file

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

View file

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