refactor: change to litterate config
Configuration is now held by the `.org` files. All `.nix` files are tangled from the org-mode files.
This commit is contained in:
+14
-24
@@ -1,27 +1,17 @@
|
||||
{
|
||||
flake.modules.nixos.i18n-input = {
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.mySystem.i18n.input;
|
||||
in {
|
||||
options.mySystem.i18n.input.enable = mkEnableOption "Enable i18n input with fcitx5";
|
||||
|
||||
config.i18n.inputMethod = mkIf cfg.enable {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-gtk
|
||||
fcitx5-mozc-ut # Japanese input support
|
||||
fcitx5-nord
|
||||
fcitx5-table-other # X-SAMPA to IPA support
|
||||
qt6Packages.fcitx5-chinese-addons # allow to load table addons
|
||||
qt6Packages.fcitx5-configtool
|
||||
qt6Packages.fcitx5-with-addons
|
||||
];
|
||||
};
|
||||
flake.modules.nixos.i18n-input = {pkgs, ...}: {
|
||||
i18n.inputMethod = {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-gtk
|
||||
fcitx5-mozc-ut
|
||||
fcitx5-nord
|
||||
fcitx5-table-other
|
||||
qt6Packages.fcitx5-chinese-addons
|
||||
qt6Packages.fcitx5-configtool
|
||||
qt6Packages.fcitx5-with-addons
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#+title: Input Methods
|
||||
#+setupfile: ../headers
|
||||
|
||||
* Input Methods
|
||||
I type in more than one script, so I need a proper input method
|
||||
framework rather than relying on whatever the desktop environment
|
||||
ships with. Plus, the default /AFNOR bépo/ layout is currently buggy,
|
||||
with some dead keys not working properly, such as =AltGr+s=, but it
|
||||
isn’t with fcitx5. Here’s the =nixos.i18n-input= module.
|
||||
#+begin_src nix :tangle yes
|
||||
{
|
||||
flake.modules.nixos.i18n-input = {pkgs, ...}: {
|
||||
i18n.inputMethod = {
|
||||
<<enable-fcitx5>>
|
||||
<<fcitx5-addons>>
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** Enabling fcitx5
|
||||
[[https://fcitx-im.org/wiki/Fcitx_5][fcitx5]] is the input method framework I’ve settled on; it covers
|
||||
everything from CJK input to custom table-based methods.
|
||||
#+name: enable-fcitx5
|
||||
#+begin_src nix
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
#+end_src
|
||||
|
||||
** Addons
|
||||
=fcitx5-gtk= gets fcitx5 working inside GTK applications, and the Qt
|
||||
equivalents (=fcitx5-configtool=, =fcitx5-with-addons=) do the same for Qt
|
||||
ones whilst also giving me a GUI to configure it all. =fcitx5-mozc-ut=
|
||||
adds Japanese input through Mozc, and
|
||||
=qt6Packages.fcitx5-chinese-addons= adds the table addons Chinese input
|
||||
methods need. I don’t actually need this package for Chinese itself,
|
||||
but it is somehow necessary for the X-SAMPA input method, which I get
|
||||
from =fcitx5-table-other=. I have it to type IPA on the fly when working
|
||||
on my constructed languages. Lastly, =fcitx5-nord= just reskins the UI
|
||||
to match the rest of my setup.
|
||||
#+name: fcitx5-addons
|
||||
#+begin_src nix
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-gtk
|
||||
fcitx5-mozc-ut
|
||||
fcitx5-nord
|
||||
fcitx5-table-other
|
||||
qt6Packages.fcitx5-chinese-addons
|
||||
qt6Packages.fcitx5-configtool
|
||||
qt6Packages.fcitx5-with-addons
|
||||
];
|
||||
#+end_src
|
||||
@@ -0,0 +1,45 @@
|
||||
#+title: Locale
|
||||
#+setupfile: ../headers
|
||||
|
||||
* Locale
|
||||
I want my system messages in English, but everything else about how
|
||||
dates, money and paper sizes are formatted to reflect where I actually
|
||||
live. Here’s the =nixos.locale= module.
|
||||
#+begin_src nix :tangle yes
|
||||
{
|
||||
flake.modules.nixos.locale = {
|
||||
i18n = {
|
||||
<<default-locale>>
|
||||
<<extra-locale-settings>>
|
||||
};
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** Default Locale
|
||||
=en_DK.UTF-8= is a well-known trick: English messages and collation, but
|
||||
ISO 8601 dates and sane metric units, instead of =en_US='s nonsense
|
||||
MM/DD/YYYY and imperial units.
|
||||
#+name: default-locale
|
||||
#+begin_src nix
|
||||
defaultLocale = "en_DK.UTF-8";
|
||||
#+end_src
|
||||
|
||||
** Regional Settings
|
||||
Since I live in France, I want addresses, money, paper size, phone
|
||||
numbers and the like to follow French conventions instead of whatever
|
||||
=en_DK= would otherwise pick.
|
||||
#+name: extra-locale-settings
|
||||
#+begin_src nix
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "fr_FR.UTF-8";
|
||||
LC_IDENTIFICATION = "fr_FR.UTF-8";
|
||||
LC_MEASUREMENT = "fr_FR.UTF-8";
|
||||
LC_MONETARY = "fr_FR.UTF-8";
|
||||
LC_NAME = "fr_FR.UTF-8";
|
||||
LC_NUMERIC = "fr_FR.UTF-8";
|
||||
LC_PAPER = "fr_FR.UTF-8";
|
||||
LC_TELEPHONE = "fr_FR.UTF-8";
|
||||
LC_TIME = "fr_FR.UTF-8";
|
||||
};
|
||||
#+end_src
|
||||
Reference in New Issue
Block a user