refactor: mkHost load-all infrastructure and convert simple features

This commit is contained in:
2026-04-12 21:27:43 +00:00
parent 3ff4583017
commit 6770bc76a2
18 changed files with 455 additions and 210 deletions

View File

@@ -1,25 +1,30 @@
{
nixos =
{ lib, config, ... }:
let
cfg = config.features.localisation;
in
{
options = {
localisation = {
timeZone = lib.mkOption {
type = lib.types.str;
};
options.features.localisation = {
enable = lib.mkEnableOption "localisation";
defaultLocale = lib.mkOption {
type = lib.types.str;
};
timeZone = lib.mkOption {
type = lib.types.str;
default = "Europe/Ljubljana";
};
defaultLocale = lib.mkOption {
type = lib.types.str;
default = "en_US.UTF-8";
};
};
config = {
time.timeZone = config.localisation.timeZone;
i18n.defaultLocale = config.localisation.defaultLocale;
config = lib.mkIf cfg.enable {
time.timeZone = cfg.timeZone;
i18n.defaultLocale = cfg.defaultLocale;
# NOTE:(@janezicmatej) some apps (e.g. java) need TZ env var explicitly
environment.variables.TZ = config.localisation.timeZone;
environment.variables.TZ = cfg.timeZone;
};
};
}