Skip to content

Commit

Permalink
feat: disable sleep mode and fonts on server
Browse files Browse the repository at this point in the history
  • Loading branch information
yunfachi committed Nov 8, 2023
1 parent 494a4dc commit 2abd891
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions modules/server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ with lib; {
./core.nix
];

# We don't need any of the X11 libraries on a server.
environment.noXlibs = mkDefault true;

# Because Perl is a default package, we need to remove it.
Expand All @@ -16,8 +17,27 @@ with lib; {
services.logrotate.enable = mkDefault false;
services.udisks2.enable = mkDefault false;

# No need for xdg on a server.
xdg.autostart.enable = mkDefault false;
xdg.icons.enable = mkDefault false;
xdg.mime.enable = mkDefault false;
xdg.sounds.enable = mkDefault false;

# No need for fonts on a server.
fonts.fontconfig.enable = lib.mkDefault false;

# Print the URL instead of opening it in a browser.
environment.variables.BROWSER = "echo";

systemd = {
enableEmergencyMode = lib.mkDefault false;

sleep.extraConfig = ''
# Disable sleep mode.
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
'';
};
}

0 comments on commit 2abd891

Please sign in to comment.