Add support for multiple machines

This commit is contained in:
2026-01-26 17:04:26 +00:00
parent 5dc8fed824
commit e3b28f3bfc
4 changed files with 31 additions and 12 deletions

View File

@@ -1,13 +1,12 @@
# Shared configuration across all machines
# Help is available in the configuration.nix(5) man page # Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running 'nixos-help').
# man configuration.nix # man configuration.nix
{ config, pkgs, inputs, ... }: { config, pkgs, inputs, ... }:
{ {
imports = [ imports = [
./hardware-configuration.nix
inputs.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
]; ];
@@ -19,8 +18,6 @@
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
# Networking # Networking
networking.hostName = "TrudePC";
#networking.wireless.enable = true;
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
time.timeZone = "Europe/Lisbon"; time.timeZone = "Europe/Lisbon";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";

View File

@@ -11,12 +11,23 @@
}; };
outputs = { self, nixpkgs, ... }@inputs: { outputs = { self, nixpkgs, ... }@inputs: {
nixosConfigurations.TrudePC = nixpkgs.lib.nixosSystem { nixosConfigurations = {
TrudePC = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
./configuration.nix ./configuration.nix
inputs.home-manager.nixosModules.default ./hosts/TrudePC
]; ];
}; };
# Add future machines here following the same pattern:
# MachineName = nixpkgs.lib.nixosSystem {
# specialArgs = { inherit inputs; };
# modules = [
# ./common.nix
# ./hosts/MachineName
# ];
# };
};
}; };
} }

View File

@@ -0,0 +1,11 @@
# TrudePC-specific configuration
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
];
# Machine-specific settings
networking.hostName = "TrudePC";
}

View File

@@ -8,7 +8,7 @@
[ (modulesPath + "/installer/scan/not-detected.nix") [ (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "ahci" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "ahci" "usbhid" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];