nixfiles/nixos/modules/server.nix

24 lines
553 B
Nix
Raw Normal View History

2022-02-06 00:06:26 +00:00
{ config, lib, ... }:
2022-02-13 13:10:21 +00:00
let
2022-02-19 22:55:53 +00:00
inherit (lib) mkIf mkDefault;
2022-02-13 17:44:14 +00:00
inherit (lib.my) mkBoolOpt';
cfg = config.my.server;
2022-02-19 22:55:53 +00:00
uname = if config.my.user.enable then config.my.user.config.name else "root";
2022-02-13 13:10:21 +00:00
in
{
2022-02-13 17:44:14 +00:00
options.my.server.enable = mkBoolOpt' false "Whether to enable common configuration for servers.";
config = mkIf cfg.enable {
2022-02-16 01:38:17 +00:00
services = {
2022-02-19 22:55:53 +00:00
getty.autologinUser = mkDefault uname;
kmscon.autologinUser = mkDefault uname;
2022-02-16 01:38:17 +00:00
};
2022-02-19 22:55:53 +00:00
my.user.homeConfig = {
2022-02-16 01:38:17 +00:00
my.gui.enable = false;
};
2022-02-13 13:10:21 +00:00
};
meta.buildDocsInSandbox = false;
2022-02-13 13:10:21 +00:00
}