diff --git a/modules/base/network/network.nix b/modules/base/network/network.nix index 8020c09..9de3c8b 100644 --- a/modules/base/network/network.nix +++ b/modules/base/network/network.nix @@ -1,6 +1,7 @@ { ... }: { - flake.nixosModules.network = {lib, ... }:{ + flake.nixosModules.network = {lib, host, ... }:{ networking.firewall.enable = true; networking.networkmanager.enable = true; + networking.hostName = host; }; } diff --git a/modules/hosts/computer-mo/hardware.nix b/modules/hosts/computer-mo/hardware.nix index 20d9772..ed54453 100644 --- a/modules/hosts/computer-mo/hardware.nix +++ b/modules/hosts/computer-mo/hardware.nix @@ -4,7 +4,6 @@ boot.kernelParams = [ "quiet" "splash" "boot.shell_on_fail" "loglevel=3" "rd.systemd.show_status=false" "rd.udev.log_level=3" "udev.log_priority=3" ]; nixpkgs.hostPlatform = "x86_64-linux"; hardware.cpu.amd.updateMicrocode = true; - networking.hostName = "computer-mo"; boot.kernelModules = [ "kvm-amd" ]; }; } diff --git a/modules/hosts/computer-mo/nixos-configurations.nix b/modules/hosts/computer-mo/nixos-configurations.nix index 9248db4..1ebae95 100644 --- a/modules/hosts/computer-mo/nixos-configurations.nix +++ b/modules/hosts/computer-mo/nixos-configurations.nix @@ -1,12 +1,14 @@ { inputs, ... }: let + system = "x86_64-linux"; + user = "mo"; + host = "computer-mo"; + mkHost = inputs.self.lib.mkHost; in { - flake.nixosConfigurations = { - computer-mo = mkHost { - user = "mo"; - extraModules = [ inputs.self.nixosModules.computer-mo ]; - }; + flake.nixosConfigurations.${host} = mkHost { + inherit system user host; + extraModules = [ inputs.self.nixosModules.${host} ]; }; } diff --git a/modules/platform/mkhost.nix b/modules/platform/mkhost.nix index 6d685e1..ed51d7f 100644 --- a/modules/platform/mkhost.nix +++ b/modules/platform/mkhost.nix @@ -1,9 +1,9 @@ { inputs, ... }: { - flake.lib.mkHost = { system ? "x86_64-linux", user, extraModules ? [] }: + flake.lib.mkHost = { system, user, host, extraModules ? [] }: inputs.nixpkgs.lib.nixosSystem { inherit system; specialArgs = { - inherit user; + inherit user host; pkgs-unstable = import inputs.nixpkgs-unstable { inherit system; config.allowUnfree = true;