From 49773421838d6571dbf2f023872f465dac65baa4 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Fri, 21 Jun 2024 10:53:20 +0200 Subject: [PATCH] feat: server beginnings --- hosts/server/default.nix | 50 +++++++++++++++++++++++++++++++++ modules/core/default-server.nix | 13 +++++++++ 2 files changed, 63 insertions(+) create mode 100644 hosts/server/default.nix create mode 100644 modules/core/default-server.nix diff --git a/hosts/server/default.nix b/hosts/server/default.nix new file mode 100644 index 0000000..11931d7 --- /dev/null +++ b/hosts/server/default.nix @@ -0,0 +1,50 @@ +{ pkgs, config, ... }: +{ + imports = [ + ./hardware-configuration.nix + ./../../modules/core + ]; + + environment.systemPackages = with pkgs; [ + acpi + powertop + ]; + + services = { + thermald.enable = true; + # cpupower-gui.enable = true; + power-profiles-daemon.enable = true; + + upower = { + enable = true; + percentageLow = 20; + percentageCritical = 5; + percentageAction = 3; + criticalPowerAction = "PowerOff"; + }; + + auto-cpufreq = { + enable = true; + settings = { + battery = { + governor = "powersave"; + turbo = "auto"; + }; + charger = { + governor = "performance"; + turbo = "auto"; + }; + }; + }; + }; + + boot = { + kernelModules = ["acpi_call"]; + extraModulePackages = with config.boot.kernelPackages; + [ + acpi_call + cpupower + ]; + # ++ [pkgs.cpupower-gui]; + }; +} diff --git a/modules/core/default-server.nix b/modules/core/default-server.nix new file mode 100644 index 0000000..562fb2c --- /dev/null +++ b/modules/core/default-server.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + imports = + [ (import ./bootloader.nix) ] + ++ [ (import ./hardware.nix) ] + ++ [ (import ./network.nix) ] + ++ [ (import ./program.nix) ] + ++ [ (import ./security.nix) ] + ++ [ (import ./services.nix) ] + ++ [ (import ./system.nix) ] + ++ [ (import ./user.nix) ] + ++ [ (import ./virtualization.nix) ]; +}