move i18n config to module
This commit is contained in:
parent
7deeaa409b
commit
35483f5c4c
3 changed files with 55 additions and 44 deletions
|
|
@ -5,7 +5,6 @@
|
|||
nixos-hardware.nixosModules.asus-fx506hm
|
||||
])
|
||||
++ [
|
||||
./i18n.nix
|
||||
./gui.nix
|
||||
./users
|
||||
./kvm.nix
|
||||
|
|
@ -22,6 +21,7 @@
|
|||
unixName = "david";
|
||||
hostName = "Tytonidae";
|
||||
};
|
||||
i18n.enable = true;
|
||||
programs = {
|
||||
dae.enable = true;
|
||||
openssh.enable = true;
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
outputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
i18n = {
|
||||
defaultLocale = "C.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "zh_CN.UTF-8";
|
||||
LC_IDENTIFICATION = "zh_CN.UTF-8";
|
||||
LC_MEASUREMENT = "zh_CN.UTF-8";
|
||||
LC_MONETARY = "zh_CN.UTF-8";
|
||||
LC_NAME = "zh_CN.UTF-8";
|
||||
LC_NUMERIC = "zh_CN.UTF-8";
|
||||
LC_PAPER = "zh_CN.UTF-8";
|
||||
LC_TELEPHONE = "zh_CN.UTF-8";
|
||||
LC_TIME = "zh_CN.UTF-8";
|
||||
};
|
||||
inputMethod = {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5 = {
|
||||
addons = with pkgs; [
|
||||
libsForQt5.fcitx5-qt
|
||||
fcitx5-gtk
|
||||
fcitx5-configtool
|
||||
fcitx5-chinese-addons
|
||||
(fcitx5-rime.override {
|
||||
rimeDataPkgs = (
|
||||
with (outputs.packages."${pkgs.system}");
|
||||
[
|
||||
rime-ice
|
||||
]
|
||||
);
|
||||
})
|
||||
];
|
||||
waylandFrontend = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
54
nixos/modules/i18n.nix
Normal file
54
nixos/modules/i18n.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
pkgs,
|
||||
outputs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.youthlic.i18n;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
youthlic.i18n = {
|
||||
enable = lib.mkEnableOption "zh env";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
i18n = {
|
||||
defaultLocale = "C.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "zh_CN.UTF-8";
|
||||
LC_IDENTIFICATION = "zh_CN.UTF-8";
|
||||
LC_MEASUREMENT = "zh_CN.UTF-8";
|
||||
LC_MONETARY = "zh_CN.UTF-8";
|
||||
LC_NAME = "zh_CN.UTF-8";
|
||||
LC_NUMERIC = "zh_CN.UTF-8";
|
||||
LC_PAPER = "zh_CN.UTF-8";
|
||||
LC_TELEPHONE = "zh_CN.UTF-8";
|
||||
LC_TIME = "zh_CN.UTF-8";
|
||||
};
|
||||
inputMethod = {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5 = {
|
||||
addons = with pkgs; [
|
||||
libsForQt5.fcitx5-qt
|
||||
fcitx5-gtk
|
||||
fcitx5-configtool
|
||||
fcitx5-chinese-addons
|
||||
(fcitx5-rime.override {
|
||||
rimeDataPkgs = (
|
||||
with (outputs.packages."${pkgs.system}");
|
||||
[
|
||||
rime-ice
|
||||
]
|
||||
);
|
||||
})
|
||||
];
|
||||
waylandFrontend = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue