From 2e5d80deac27053ed17d230d1b145450dff7b9b7 Mon Sep 17 00:00:00 2001 From: Mikael Voss Date: Mon, 29 Jul 2024 17:08:32 +0200 Subject: [PATCH] Avoid rebuilding of packages --- flake.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index a712b3e..3319488 100644 --- a/flake.nix +++ b/flake.nix @@ -1,18 +1,20 @@ { description = "Custom locale"; outputs = { self, ... }: { - overlays.default = final: prev: { - glibcLocales = prev.glibcLocales.overrideAttrs (base: { + nixosModules.default = { config, lib, pkgs, ... }: { + i18n.defaultLocale = lib.mkDefault "en_EU.UTF-8"; + + i18n.glibcLocales = (pkgs.glibcLocales.overrideAttrs (base: { postPatch = base.postPatch + '' - cp ${prev.lib.escapeShellArg ./en_EU} localedata/locales/en_EU + cp ${./en_EU} localedata/locales/en_EU echo 'en_EU.UTF-8/UTF-8 \' >>localedata/SUPPORTED ''; - }); - }; + })).override { + allLocales = builtins.any (x: x == "all") + config.i18n.supportedLocales; - nixosModules.default = { lib, ... }: { - nixpkgs.overlays = [ self.overlays.default ]; - i18n.defaultLocale = lib.mkDefault "en_EU.UTF-8"; + locales = config.i18n.supportedLocales; + }; }; }; }