initial commit for module-refactor
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
{pkgs, ...}: {
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot.configurationLimit = 10;
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
{pkgs, lib, config, ...}: {
|
||||
options = {
|
||||
# make this enabled by default!!!
|
||||
bootLoader.enable = lib.mkEnableOption "enables bootloader config";
|
||||
};
|
||||
config = lib.mkIf config.bootLoader.enable {
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot.configurationLimit = 10;
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@
|
||||
}: {
|
||||
imports =
|
||||
[(import ./bootloader.nix)]
|
||||
++ [(import ./network.nix)];
|
||||
++ [(import ./network.nix)]
|
||||
++ [(import ./powerprofiles.nix)];
|
||||
}
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
{host, ...}: let
|
||||
{host, lib, config, ...}: let
|
||||
desktop = host == "oganesson";
|
||||
in {
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName =
|
||||
if desktop
|
||||
then "oganesson"
|
||||
else "mercury";
|
||||
hosts = {
|
||||
"192.168.1.201" = ["glasshaus"];
|
||||
"192.168.1.111" = ["argon"];
|
||||
"192.168.1.223" = ["mercury"];
|
||||
};
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [30000];
|
||||
options = {
|
||||
networkModule.enable = lib.mkEnableOption "enables network configuration";
|
||||
};
|
||||
config = lib.mkIf config.networkModule.enable {
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName =
|
||||
if desktop
|
||||
then "oganesson"
|
||||
else "mercury";
|
||||
hosts = {
|
||||
"192.168.1.201" = ["xenon"];
|
||||
"192.168.1.111" = ["argon"];
|
||||
"192.168.1.223" = ["mercury"];
|
||||
};
|
||||
firewall = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
51
modules/sys/hardware/powerprofiles.nix
Normal file
51
modules/sys/hardware/powerprofiles.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{lib, config, ... }: {
|
||||
options = {
|
||||
powerProfiles.enable = lib.mkEnableOption "enables power profiles";
|
||||
};
|
||||
config = lib.mkIf config.powerProfiles.enable {
|
||||
services = {
|
||||
keyd = {
|
||||
enable = true;
|
||||
keyboards.default = {
|
||||
ids = ["*"];
|
||||
settings.main = {
|
||||
capslock = "esc";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
power-profiles-daemon.enable = true;
|
||||
|
||||
upower = {
|
||||
enable = true;
|
||||
percentageLow = 20;
|
||||
percentageCritical = 5;
|
||||
percentageAction = 3;
|
||||
criticalPowerAction = "PowerOff";
|
||||
};
|
||||
|
||||
tlp.settings = {
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "power";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
|
||||
CPU_BOOST_ON_AC = 1;
|
||||
CPU_BOOST_ON_BAT = 1;
|
||||
|
||||
CPU_HWP_DYN_BOOST_ON_AC = 1;
|
||||
CPU_HWP_DYN_BOOST_ON_BAT = 1;
|
||||
|
||||
PLATFORM_PROFILE_ON_AC = "performance";
|
||||
PLATFORM_PROFILE_ON_BAT = "performance";
|
||||
|
||||
INTEL_GPU_MIN_FREQ_ON_AC = 500;
|
||||
INTEL_GPU_MIN_FREQ_ON_BAT = 500;
|
||||
# INTEL_GPU_MAX_FREQ_ON_AC=0;
|
||||
# INTEL_GPU_MAX_FREQ_ON_BAT=0;
|
||||
# INTEL_GPU_BOOST_FREQ_ON_AC=0;
|
||||
# INTEL_GPU_BOOST_FREQ_ON_BAT=0;
|
||||
|
||||
PCIE_ASPM_ON_AC = "default";
|
||||
PCIE_ASPM_ON_BAT = "powersupersave";
|
||||
};
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user