diff --git a/flake.nix b/flake.nix index 103aaf3..8e66f0d 100755 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "all this does now is pass inputs to other modules and set the system variable"; + description = "My configuration(s) for the NixOS Linux Distribution"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; @@ -39,18 +39,21 @@ outputs = inputs@{ ... }: let system = inputs.nixpkgs.lib.mkDefault "x86_64-linux"; - nixosSystem = + mkHost = hostName: inputs.nixpkgs.lib.nixosSystem { - specialArgs = { inherit hostName inputs system; }; - modules = [ ./hosts/${hostName} ]; + specialArgs = { inherit inputs system; }; + modules = [ + { networking.hostName = hostName; } + ./hosts/${hostName} + ]; }; in { nixosConfigurations = { - Swordsmachine = nixosSystem "Swordsmachine"; - Earthmover = nixosSystem "Earthmover"; - Drone = nixosSystem "Drone"; - Mindflayer = nixosSystem "Mindflayer"; + Swordsmachine = mkHost "Swordsmachine"; + Earthmover = mkHost "Earthmover"; + Drone = mkHost "Drone"; + Mindflayer = mkHost "Mindflayer"; }; }; } diff --git a/hosts/Drone/default.nix b/hosts/Drone/default.nix index 02e5e4c..52f81bd 100755 --- a/hosts/Drone/default.nix +++ b/hosts/Drone/default.nix @@ -1,4 +1,4 @@ -{ hostName, inputs, config, lib, pkgs, ... }: +{ inputs, config, lib, pkgs, ... }: { imports = [ @@ -60,14 +60,11 @@ services.zfs.autoScrub.enable = true; - networking = { - hostName = "${hostName}"; - firewall = lib.mkForce { - allowedTCPPorts = []; - allowedTCPPortRanges = []; - allowedUDPPorts = []; - allowedUDPPortRanges = []; - }; + networking.firewall = lib.mkForce { + allowedTCPPorts = []; + allowedTCPPortRanges = []; + allowedUDPPorts = []; + allowedUDPPortRanges = []; }; # for cloudflare browser ssh diff --git a/modules/common/default.nix b/modules/common/default.nix index 2ae5164..ff4efda 100755 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -1,11 +1,10 @@ -{ config, pkgs, lib, ... }: +{ config, ... }: { imports = [ ./boot.nix ./default-packages.nix ./locales.nix - ./networking.nix ./nix.nix ./users.nix ]; diff --git a/modules/common/networking.nix b/modules/common/networking.nix deleted file mode 100755 index c979bb9..0000000 --- a/modules/common/networking.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ hostName, config, ... }: - -{ - networking.hostName = "${hostName}"; -} \ No newline at end of file diff --git a/modules/common/users.nix b/modules/common/users.nix index a58e0b3..d763771 100755 --- a/modules/common/users.nix +++ b/modules/common/users.nix @@ -1,9 +1,9 @@ -{ hostName, config, ... }: +{ config, ... }: { users.users.wo2w = { isNormalUser = true; - description = "${hostName}"; + description = config.networking.hostName; extraGroups = [ "networkmanager" "wheel" ]; # make new user logins (iso/vm/new machine) use a default password