feat(system): add headless server specialisation and toggle aliases
- Implement `specialisation.server` in `hosts/desktop/configuration.nix`: - Disable graphical environments (`greetd`, `Hyprland`, `dms-shell`). - Disable peripheral services (`pipewire`, `printing`, `bluetooth`, `blueman`) to trim resource overhead. - Disable power-saving suspend/sleep/hibernate targets to maintain 24/7 server uptime. - Enable `powertop` for active kernel power management. - Add `server-on` and `server-off` shell aliases in `modules/user/base.nix` for rapid mode switching. Rationale: Enables dual-role capability for the workstation, allowing it to pivot into an optimized, always-on headless server environment on demand.
This commit is contained in:
1 parent
f658a86581
commit
5601dec716
2 files changed
+25
No files matched your search
@@ -63,6 +63,29 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Specialisation for headless server mode
|
||||
specialisation.server.configuration = {
|
||||
# 1. Disable display manager and window manager
|
||||
services.greetd.enable = lib.mkForce false;
|
||||
programs.hyprland.enable = lib.mkForce false;
|
||||
programs.dms-shell.enable = lib.mkForce false;
|
||||
|
||||
# 2. Disable peripheral hardware services to reduce power consumption
|
||||
services.pipewire.enable = lib.mkForce false;
|
||||
services.printing.enable = lib.mkForce false;
|
||||
hardware.bluetooth.enable = lib.mkForce false;
|
||||
services.blueman.enable = lib.mkForce false;
|
||||
|
||||
# 3. Disable power-saving suspend/sleep/hibernate behaviors to keep server active
|
||||
systemd.targets.sleep.enable = lib.mkForce false;
|
||||
systemd.targets.suspend.enable = lib.mkForce false;
|
||||
systemd.targets.hibernate.enable = lib.mkForce false;
|
||||
systemd.targets.hybrid-sleep.enable = lib.mkForce false;
|
||||
|
||||
# 4. Enable active kernel-level power management tuning
|
||||
powerManagement.powertop.enable = lib.mkForce true;
|
||||
};
|
||||
|
||||
# Rebuild/State version. Do not modify.
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
@@ -133,6 +133,8 @@
|
||||
|
||||
# System Administration
|
||||
nix-switch = "sudo nixos-rebuild switch --flake ~/Config#$(hostname)";
|
||||
server-on = "sudo /run/current-system/specialisation/server/bin/switch-to-configuration switch";
|
||||
server-off = "sudo /run/current-system/bin/switch-to-configuration switch";
|
||||
sys = "dgop";
|
||||
wifi = "nmtui";
|
||||
lock = "hyprlock";
|
||||
|
||||
Reference in new issue
Block a user