1
1
Fork 0
nixos-configs/modules/beatific.nix

37 lines
727 B
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkOption types;
cfg = config.beatific;
in {
options = {
beatific = {
hostName = mkOption {
type = types.str;
description = "Hostname";
};
defaults = {
time = mkOption {
type = types.bool;
description = "Default time zone and NTP";
default = true;
};
};
};
};
config = mkMerge [
{
networking.hostName = cfg.hostName;
nix.extraOptions = "experimental-features = nix-command flakes";
}
(mkIf cfg.defaults.time {
time.timeZone = "UTC";
services.ntp.enable = true;
services.ntp.servers = [ "time.nist.gov" ];
})
];
}