refactor(hosts): simplify configuration imports across hosts

This commit is contained in:
tux
2026-05-13 04:33:14 +05:30
parent 71aaf2d392
commit b649b974fa
15 changed files with 137 additions and 98 deletions

View File

@@ -10,7 +10,6 @@
{
imports = with config.flake.modules.nixos; [
boot
hardware
networking
desktop
gaming
@@ -120,20 +119,7 @@
firewall.enable = false;
};
# --- Hardware / GPU ---
# hardware = {
# nvidia = {
# modesetting.enable = true;
# open = false;
# nvidiaSettings = true;
# };
# };
# boot.kernelParams = [ "nvidia-drm.modeset=1" ];
# nixpkgs.config.cudaSupport = true;
# services.xserver.videoDrivers = [ "nvidia" ];
environment.systemPackages = with pkgs; [
nvtopPackages.full
davinci-resolve
telegram-desktop
];

View File

@@ -14,7 +14,14 @@ in
{
flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit hostName userName userEmail; };
specialArgs = {
inherit
hostName
userName
userEmail
system
;
};
modules = [
config.flake.modules.nixos.core
config.flake.modules.nixos.${hostName}

View File

@@ -1,11 +1,16 @@
{ config, ... }:
{
flake.modules.nixos.canopus =
{
config,
lib,
system,
...
}:
}@innerArgs:
{
imports = with config.flake.modules.nixos; [
hardware
];
boot.initrd.availableKernelModules = [
"nvme"
"xhci_pci"
@@ -18,15 +23,9 @@
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp10s0f3u2i2.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault innerArgs.config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault system;
};
}