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

37 lines
727 B
Nix
Raw Normal View History

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