modules/monitoring: add loki and promtail
This commit is contained in:
parent
92db38383e
commit
4b5b41b05a
20 changed files with 406 additions and 86 deletions
38
modules/nixos/common-settings/mainland.nix
Normal file
38
modules/nixos/common-settings/mainland.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkOption
|
||||
types
|
||||
mkDefault
|
||||
;
|
||||
|
||||
cfg = config.inMainland;
|
||||
in
|
||||
{
|
||||
options.inMainland = mkOption {
|
||||
type = types.bool;
|
||||
default = config.time.timeZone == "Asia/Shanghai";
|
||||
};
|
||||
|
||||
config = mkIf cfg {
|
||||
nix.settings.extra-substituters = [
|
||||
"https://mirrors.cernet.edu.cn/nix-channels/store?priority=20"
|
||||
];
|
||||
|
||||
networking.timeServers = [
|
||||
"cn.ntp.org.cn"
|
||||
"ntp.ntsc.ac.cn"
|
||||
];
|
||||
|
||||
services.dae = {
|
||||
enable = mkDefault true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue