From b017594b1ec2a7457f14019766f2b486ae47648d Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Fri, 28 Jul 2023 20:16:25 -0400 Subject: [PATCH] added auto hostName config --- hosts/game-laptop/main.nix | 7 +++---- hosts/gerg-desktop/main.nix | 1 - hosts/moms-laptop/main.nix | 9 +++++---- lib/default.nix | 7 ++++++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/hosts/game-laptop/main.nix b/hosts/game-laptop/main.nix index 3daee42..42b9b21 100644 --- a/hosts/game-laptop/main.nix +++ b/hosts/game-laptop/main.nix @@ -43,10 +43,9 @@ _: { "jdks/8".source = "${pkgs.openjdk8}/bin"; }; }; - networking = { - hostName = "game-laptop"; - networkmanager.enable = true; - }; + + networking.networkmanager.enable = true; + services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password"; #user managment sops.secrets.root.neededForUsers = true; diff --git a/hosts/gerg-desktop/main.nix b/hosts/gerg-desktop/main.nix index 2e56efa..8539f07 100644 --- a/hosts/gerg-desktop/main.nix +++ b/hosts/gerg-desktop/main.nix @@ -81,7 +81,6 @@ networking = { useDHCP = false; - hostName = "gerg-desktop"; hostId = "288b56db"; nameservers = [ "192.168.1.1" diff --git a/hosts/moms-laptop/main.nix b/hosts/moms-laptop/main.nix index aa27042..b7cc897 100644 --- a/hosts/moms-laptop/main.nix +++ b/hosts/moms-laptop/main.nix @@ -31,12 +31,13 @@ _: { ; }; services.xserver.videoDrivers = ["intel"]; - networking = { - hostName = "moms-laptop"; - networkmanager.enable = true; - }; + + networking.networkmanager.enable = true; + boot.kernelPackages = pkgs.linuxPackages_latest; + sops.secrets.root.neededForUsers = true; + users = { mutableUsers = false; users = { diff --git a/lib/default.nix b/lib/default.nix index 616553c..47b2052 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -53,7 +53,12 @@ in { inherit system; modules = builtins.attrValues self.nixosModules - ++ importAll "${self}/hosts/${name}"; + ++ importAll "${self}/hosts/${name}" + ++ [ + { + networking.hostName = name; + } + ]; } ); mkDisko = names: