fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Rodney Lorrimari18n: Use glibcLocales from NixOS if possible (#2333) (#4177)3be2abb2

master
1.1 KiB39 linesraw
1{
2  i18n = { ... }: {
3    config = {
4      nmt.script = ''
5        hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
6        assertFileExists $hmEnvFile
7        assertFileRegex $hmEnvFile \
8          '^export LOCALE_ARCHIVE_._..=".*/lib/locale/locale-archive"$'
9
10        envFile=home-files/.config/environment.d/10-home-manager.conf
11        assertFileExists $envFile
12        assertFileRegex $envFile \
13          '^LOCALE_ARCHIVE_._..=.*/lib/locale/locale-archive$'
14      '';
15    };
16  };
17
18  i18n-custom-locales = { pkgs, ... }: {
19    config = let stub = pkgs.glibcLocalesCustom;
20    in {
21      test.stubs.glibcLocalesCustom = {
22        inherit (pkgs.glibcLocales) version;
23        outPath = null; # we need a real path for this stub
24      };
25
26      i18n.glibcLocales = stub;
27
28      nmt.script = ''
29        hmEnvFile=home-path/etc/profile.d/hm-session-vars.sh
30        assertFileExists $hmEnvFile
31        assertFileRegex $hmEnvFile 'LOCALE_ARCHIVE_.*${stub}'
32
33        envFile=home-files/.config/environment.d/10-home-manager.conf
34        assertFileExists $envFile
35        assertFileRegex $envFile 'LOCALE_ARCHIVE_.*${stub}'
36      '';
37    };
38  };
39}