mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-06-21 03:36:32 +05:30
refactor(hosts): simplify configuration imports across hosts
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
{
|
||||
flake.modules.nixos.arcturus =
|
||||
{
|
||||
pkgs,
|
||||
hostName,
|
||||
userName,
|
||||
...
|
||||
@@ -10,7 +9,6 @@
|
||||
{
|
||||
imports = with config.flake.modules.nixos; [
|
||||
boot
|
||||
hardware
|
||||
networking
|
||||
virtualisation
|
||||
services
|
||||
@@ -109,10 +107,6 @@
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvtopPackages.full
|
||||
];
|
||||
|
||||
system.stateVersion = "26.05";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
flake.modules.nixos.arcturus =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
}@innerArgs:
|
||||
{
|
||||
imports = with config.flake.modules.nixos; [
|
||||
hardware
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
@@ -18,15 +24,13 @@
|
||||
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;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvtopPackages.amd
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user