Add HomeManager module

This commit is contained in:
Mikael 2024-07-30 14:24:13 +02:00
parent b7487f3484
commit e5ab14ce37

View file

@ -1,20 +1,31 @@
{
description = "Custom locale";
outputs = { self, ... }: {
nixosModules.default = { config, lib, pkgs, ... }: {
i18n.defaultLocale = lib.mkDefault "en_EU.UTF-8";
i18n.glibcLocales = (pkgs.glibcLocales.overrideAttrs (base: {
outputs = { self, ... }:
let
patchLocales = { lib, pkgs, ... }: ovr:
(pkgs.glibcLocales.overrideAttrs (base: {
postPatch = base.postPatch + ''
cp ${lib.escapeShellArg ./en_EU} localedata/locales/en_EU
echo 'en_EU.UTF-8/UTF-8 \' >>localedata/SUPPORTED
'';
})).override {
})).override ovr;
in {
nixosModules.default = { config, lib, pkgs, ... }@args: {
i18n.defaultLocale = lib.mkDefault "en_EU.UTF-8";
i18n.glibcLocales = patchLocales args {
allLocales = builtins.any (x: x == "all")
config.i18n.supportedLocales;
locales = config.i18n.supportedLocales;
};
};
hmModules.default = { lib, pkgs, ... }@args: {
home.sessionVariables.LANG = lib.mkDefault "en_EU.UTF-8";
i18n.glibcLocales = patchLocales args {
allLocales = false;
locales = [ "en_EU.UTF-8" ];
};
};
};
}