This repository has been archived on 2024-08-18. You can view files and clone it, but cannot push or open issues or pull requests.
en_EU/flake.nix

36 lines
1.1 KiB
Nix
Raw Normal View History

2024-07-24 10:24:37 +02:00
{
description = "Custom locale";
2024-07-31 15:18:18 +02:00
outputs = { self, ... }:
let patchLocales = pkgs: args:
let glibcLocales =
if pkgs.glibcLocales == null
then pkgs.callPackage
(pkgs.path + "/pkgs/development/libraries/glibc/locales.nix") args
else pkgs.glibcLocales.override args;
in glibcLocales.overrideAttrs (base: {
2024-07-24 10:24:37 +02:00
postPatch = base.postPatch + ''
2024-07-30 14:24:13 +02:00
cp ${./en_EU} localedata/locales/en_EU
2024-07-24 10:24:37 +02:00
echo 'en_EU.UTF-8/UTF-8 \' >>localedata/SUPPORTED
'';
2024-07-31 15:18:18 +02:00
});
2024-07-30 14:24:13 +02:00
in {
nixosModules.default = { config, lib, pkgs, ... }: {
i18n.defaultLocale = lib.mkDefault "en_EU.UTF-8";
i18n.glibcLocales = patchLocales pkgs {
2024-07-29 17:08:32 +02:00
allLocales = builtins.any (x: x == "all")
config.i18n.supportedLocales;
2024-07-24 10:24:37 +02:00
2024-07-29 17:08:32 +02:00
locales = config.i18n.supportedLocales;
};
2024-07-24 10:24:37 +02:00
};
2024-07-30 14:24:13 +02:00
homeModules.default = { lib, pkgs, ... }: {
2024-08-06 23:48:43 +02:00
home.language.base = lib.mkDefault "en_EU.UTF-8";
2024-07-30 14:24:13 +02:00
i18n.glibcLocales = patchLocales pkgs {
allLocales = false;
locales = [ "en_EU.UTF-8/UTF-8" ];
};
};
2024-07-24 10:24:37 +02:00
};
}