Files
nixfiles/nixos/modules/server.nix
T
jackos1998 93529c578b
CI / Check, build and cache nixfiles (push) Successful in 2h20m51s
"Release" 26.06 Irritating
2026-06-13 16:00:18 +01:00

41 lines
1.0 KiB
Nix

{ lib, pkgs, config, ... }:
let
inherit (lib) mkIf mkDefault;
inherit (lib.my) mkBoolOpt' mkDefault';
cfg = config.my.server;
uname = if config.my.user.enable then config.my.user.config.name else "root";
in
{
options.my.server.enable = mkBoolOpt' false "Whether to enable common configuration for servers.";
config = mkIf cfg.enable {
services = {
getty.autologinUser = mkDefault uname;
resolved.settings.Resolve.LLMNR = mkDefault "false";
};
systemd = {
timers = {
fstrim = mkIf config.services.fstrim.enable {
timerConfig = {
# Upstream unit has these at crazy high values that probably
# make sense on desktops / laptops
AccuracySec = "1min";
RandomizedDelaySec = "5min";
};
};
};
};
my = {
gui.enable = false;
user.homeConfig = {
my.gui.enable = false;
};
};
documentation.nixos.enable = mkDefault' false;
};
meta.buildDocsInSandbox = false;
}