treewide: simplify
This commit is contained in:
parent
91dfa05ef9
commit
887c187cb0
4 changed files with 38 additions and 53 deletions
|
@ -1,24 +1,23 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
nix.settings = {
|
||||
trusted-users = ["@admin"];
|
||||
substituters =
|
||||
lib.mkMerge
|
||||
[
|
||||
(lib.mkIf (config.time.timeZone == "Asia/Shanghai") [
|
||||
{
|
||||
"Asia/Shanghai" = [
|
||||
"https://mirrors.ustc.edu.cn/nix-channels/store" # USTC - 中国科学技术大学 Mirror
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # TUNA - 清华大学 Mirror
|
||||
"https://mirrors.bfsu.edu.cn/nix-channels/store" # BFSU - 北京外国语大学 Mirror
|
||||
"https://mirror.sjtu.edu.cn/nix-channels/store" # SJTU - 上海交通大学 Mirror
|
||||
])
|
||||
[
|
||||
];
|
||||
}
|
||||
.${config.time.timeZone}
|
||||
++ [
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cache.garnix.io"
|
||||
]
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
|
|
|
@ -17,21 +17,23 @@ in {
|
|||
};
|
||||
|
||||
config = {
|
||||
networking.nameservers = lib.mkMerge [
|
||||
(lib.mkIf (cfg.provider == "google") [
|
||||
networking.nameservers =
|
||||
{
|
||||
google = [
|
||||
### Google DNS
|
||||
"8.8.8.8"
|
||||
"8.8.4.4"
|
||||
"2001:4860:4860::8888"
|
||||
"2001:4860:4860::8844"
|
||||
])
|
||||
(lib.mkIf (cfg.provider == "alidns") [
|
||||
];
|
||||
alidns = [
|
||||
### AliDNS
|
||||
"223.5.5.5"
|
||||
"223.6.6.6"
|
||||
"2400:3200::1"
|
||||
"2400:3200:baba::1"
|
||||
])
|
||||
];
|
||||
}
|
||||
.${cfg.provider};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,23 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
{config, ...}: {
|
||||
nix.settings = {
|
||||
trusted-users = ["@wheel"];
|
||||
substituters =
|
||||
lib.mkMerge
|
||||
[
|
||||
(lib.mkIf (config.time.timeZone == "Asia/Shanghai") [
|
||||
{
|
||||
"Asia/Shanghai" = [
|
||||
"https://mirrors.ustc.edu.cn/nix-channels/store" # USTC - 中国科学技术大学 Mirror
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # TUNA - 清华大学 Mirror
|
||||
"https://mirrors.bfsu.edu.cn/nix-channels/store" # BFSU - 北京外国语大学 Mirror
|
||||
"https://mirror.sjtu.edu.cn/nix-channels/store" # SJTU - 上海交通大学 Mirror
|
||||
])
|
||||
[
|
||||
];
|
||||
}
|
||||
.${config.time.timeZone}
|
||||
++ [
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cache.garnix.io"
|
||||
]
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
|
@ -33,13 +29,6 @@
|
|||
};
|
||||
|
||||
system = {
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
# accidentally delete configuration.nix.
|
||||
|
||||
# Does not work with flake based configurations
|
||||
copySystemConfiguration = lib.mkDefault true;
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It's perfectly fine and recommended to leave
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
{pkgs, ...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = lib.mkMerge [
|
||||
settings =
|
||||
{
|
||||
add_newline = false;
|
||||
line_break.disabled = true;
|
||||
|
@ -19,7 +15,6 @@
|
|||
vimcmd_visual_symbol = "[<](bold yellow)";
|
||||
};
|
||||
}
|
||||
(builtins.fromTOML (builtins.readFile "${pkgs.starship}/share/starship/presets/nerd-font-symbols.toml"))
|
||||
];
|
||||
// (builtins.fromTOML (builtins.readFile "${pkgs.starship}/share/starship/presets/nerd-font-symbols.toml"));
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue