global/locale: init, refactored from modules/locale
This commit is contained in:
parent
1645a8a3a8
commit
421d490af1
3 changed files with 36 additions and 51 deletions
23
modules/global/locale.nix
Normal file
23
modules/global/locale.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ common, ... }:
|
||||||
|
let
|
||||||
|
cfg = common.locale;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
common.locale = {
|
||||||
|
keymap = "us";
|
||||||
|
locale = "en_US.UTF-8";
|
||||||
|
timezone = "America/New_York";
|
||||||
|
};
|
||||||
|
|
||||||
|
console.keyMap = cfg.keymap;
|
||||||
|
services.xserver.xkb = {
|
||||||
|
layout = cfg.keymap;
|
||||||
|
options = "compose:ralt";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.libinput.enable = true;
|
||||||
|
|
||||||
|
i18n.defaultLocale = cfg.locale;
|
||||||
|
|
||||||
|
time.timeZone = cfg.timezone;
|
||||||
|
}
|
|
@ -1,39 +0,0 @@
|
||||||
{ config, options, lib, ... }:
|
|
||||||
with lib;
|
|
||||||
with lib.our;
|
|
||||||
let
|
|
||||||
cfg = config.modules.locale;
|
|
||||||
opt = options.modules.locale;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.locale = with types; {
|
|
||||||
keymap = mkOpt str "us";
|
|
||||||
locale = mkOpt str "en_US.UTF-8";
|
|
||||||
timezone = mkOpt (nullOr str) "America/New_York";
|
|
||||||
|
|
||||||
fonts = {
|
|
||||||
fonts = mkOpt (listOf package) [ ];
|
|
||||||
defaults = mkOpt attrs { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
console.keyMap = mkDefault cfg.keymap;
|
|
||||||
services.xserver.xkb = {
|
|
||||||
layout = mkDefault cfg.keymap;
|
|
||||||
options = "compose:ralt";
|
|
||||||
};
|
|
||||||
services.libinput.enable = true;
|
|
||||||
|
|
||||||
i18n.defaultLocale = cfg.locale;
|
|
||||||
|
|
||||||
time.timeZone = mkIf (cfg.timezone != null) cfg.timezone;
|
|
||||||
|
|
||||||
fonts = {
|
|
||||||
packages = cfg.fonts.fonts;
|
|
||||||
fontconfig.defaultFonts = mkAliasDefinitions opt.fonts.defaults;
|
|
||||||
};
|
|
||||||
|
|
||||||
console.packages = cfg.fonts.fonts;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -84,19 +84,20 @@ in
|
||||||
# in
|
# in
|
||||||
# (lib.mkForce "${editorScript}/bin/emacseditor");
|
# (lib.mkForce "${editorScript}/bin/emacseditor");
|
||||||
|
|
||||||
modules = {
|
fonts.packages = with pkgs; [
|
||||||
locale.fonts = {
|
(nerdfonts.override {
|
||||||
fonts = with pkgs; [
|
fonts = [ "DejaVuSansMono" "NerdFontsSymbolsOnly" ];
|
||||||
(nerdfonts.override { fonts = config.modules.locale.fonts.defaults.monospace ++ [ "NerdFontsSymbolsOnly" ]; })
|
})
|
||||||
dejavu_fonts
|
dejavu_fonts
|
||||||
emacs-all-the-icons-fonts
|
emacs-all-the-icons-fonts
|
||||||
];
|
];
|
||||||
|
|
||||||
defaults = {
|
fonts.fontconfig.defaultFonts = {
|
||||||
monospace = [ "DejaVuSansMono" ];
|
monospace = [ "DejaVuSansMono" ];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
modules = {
|
||||||
desktop.wm.qtile.enable = true;
|
desktop.wm.qtile.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue