diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix index d3f24e280c7..f2aacf9b292 100644 --- a/nixos/modules/config/i18n.nix +++ b/nixos/modules/config/i18n.nix @@ -74,14 +74,17 @@ in config = { - environment.systemPackages = [ glibcLocales ]; + environment.systemPackages = + optional (config.i18n.supportedLocales != []) glibcLocales; environment.sessionVariables = { LANG = config.i18n.defaultLocale; LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; }; - systemd.globalEnvironment.LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; + systemd.globalEnvironment = mkIf (config.i18n.supportedLocales != []) { + LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; + }; # ‘/etc/locale.conf’ is used by systemd. environment.etc = singleton diff --git a/nixos/modules/profiles/minimal.nix b/nixos/modules/profiles/minimal.nix index 5067622aaf1..69729923e03 100644 --- a/nixos/modules/profiles/minimal.nix +++ b/nixos/modules/profiles/minimal.nix @@ -3,6 +3,9 @@ { config, lib, pkgs, ... }: +with lib; + { - environment.noXlibs = true; + environment.noXlibs = mkDefault true; + i18n.supportedLocales = [ config.i18n.defaultLocale ]; }