modules/monitoring: add loki and promtail
This commit is contained in:
parent
92db38383e
commit
a0248fe7e3
20 changed files with 406 additions and 82 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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -21,7 +21,6 @@ in
|
|||
default = true;
|
||||
type = types.bool;
|
||||
};
|
||||
enableMirrors = mkEnableOption "cache.nixos.org mirrors in Mainland China";
|
||||
signing = {
|
||||
enable = mkEnableOption "Sign locally-built paths";
|
||||
keyFile = mkOption {
|
||||
|
@ -55,10 +54,6 @@ in
|
|||
"https://cache.garnix.io"
|
||||
];
|
||||
|
||||
extra-substituters = mkIf cfg.enableMirrors [
|
||||
"https://mirrors.cernet.edu.cn/nix-channels/store?priority=20"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||
|
|
|
@ -9,8 +9,6 @@ let
|
|||
mkIf
|
||||
mkEnableOption
|
||||
mkOption
|
||||
mkDefault
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.commonSettings.proxyServer;
|
||||
|
@ -26,6 +24,9 @@ let
|
|||
mkSingConfig =
|
||||
{ uuid, password, ... }:
|
||||
{
|
||||
log = {
|
||||
level = "warn";
|
||||
};
|
||||
inbounds =
|
||||
[
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue