From a4b8cd941de364bd4f63bf36faacd3b7af302bd7 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Sun, 1 Dec 2024 17:03:08 +0100 Subject: [PATCH] Automatically set hostname --- machines/atlas/configuration.nix | 1 - machines/gamepc/configuration.nix | 1 - machines/jefke/configuration.nix | 1 - machines/lewis/configuration.nix | 1 - machines/sue/configuration.nix | 1 - machines/warwick/configuration.nix | 1 - nixos/default.nix | 1 + 7 files changed, 1 insertion(+), 6 deletions(-) diff --git a/machines/atlas/configuration.nix b/machines/atlas/configuration.nix index 04ae6a2..e555007 100644 --- a/machines/atlas/configuration.nix +++ b/machines/atlas/configuration.nix @@ -2,7 +2,6 @@ config = { facter.reportPath = ./facter.json; # TODO: should set this automatically - networking.hostName = "atlas"; system.stateVersion = "23.05"; users.users.root.openssh.authorizedKeys.keys = config.pim.ssh.keys.pim ++ config.pim.ssh.keys.niels; # TODO: set this as a default? diff --git a/machines/gamepc/configuration.nix b/machines/gamepc/configuration.nix index 8151e87..e2b7010 100644 --- a/machines/gamepc/configuration.nix +++ b/machines/gamepc/configuration.nix @@ -10,7 +10,6 @@ }; facter.reportPath = ./facter.json; - networking.hostName = "gamepc"; home-manager.users.pim.imports = [./pim.home.nix]; programs.steam.enable = true; system.stateVersion = "24.05"; diff --git a/machines/jefke/configuration.nix b/machines/jefke/configuration.nix index b4ee286..da2b383 100644 --- a/machines/jefke/configuration.nix +++ b/machines/jefke/configuration.nix @@ -1,7 +1,6 @@ {config, ...}: { config = { facter.reportPath = ./facter.json; - networking.hostName = "jefke"; system.stateVersion = "23.05"; users.users.root.openssh.authorizedKeys.keys = config.pim.ssh.keys.pim ++ config.pim.ssh.keys.niels; sops.age.keyFile = "/root/.config/sops/age/keys.txt"; diff --git a/machines/lewis/configuration.nix b/machines/lewis/configuration.nix index b0f1922..566d0d1 100644 --- a/machines/lewis/configuration.nix +++ b/machines/lewis/configuration.nix @@ -5,7 +5,6 @@ }: { config = { facter.reportPath = ./facter.json; - networking.hostName = "lewis"; system.stateVersion = "23.05"; users.users.root.openssh.authorizedKeys.keys = config.pim.ssh.keys.pim ++ config.pim.ssh.keys.niels; diff --git a/machines/sue/configuration.nix b/machines/sue/configuration.nix index 4af3ffc..04abc7b 100644 --- a/machines/sue/configuration.nix +++ b/machines/sue/configuration.nix @@ -35,7 +35,6 @@ facter.reportPath = ./facter.json; home-manager.users.pim.imports = [./pim.home.nix]; - networking.hostName = "sue"; nix.settings.trusted-users = ["pim"]; system.stateVersion = "23.05"; diff --git a/machines/warwick/configuration.nix b/machines/warwick/configuration.nix index d867b03..2575431 100644 --- a/machines/warwick/configuration.nix +++ b/machines/warwick/configuration.nix @@ -14,7 +14,6 @@ }; facter.reportPath = ./facter.json; - networking.hostName = "warwick"; system.stateVersion = "23.05"; systemd.network.networks."30-main-nic" = { diff --git a/nixos/default.nix b/nixos/default.nix index 3272944..5ea4759 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -160,6 +160,7 @@ }; networking = { + hostName = name; useDHCP = lib.mkDefault true; networkmanager.unmanaged = lib.mkIf config.services.tailscale.enable ["tailscale0"]; wireless.extraConfig = ''