Skip to content

Instantly share code, notes, and snippets.

@zarelit
Forked from peti/README.md
Created March 28, 2022 11:44
Show Gist options
  • Select an option

  • Save zarelit/0eb0236d357df68503b6907dca1a91f2 to your computer and use it in GitHub Desktop.

Select an option

Save zarelit/0eb0236d357df68503b6907dca1a91f2 to your computer and use it in GitHub Desktop.

Revisions

  1. @peti peti revised this gist Jun 30, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions multi-glibc-locale-paths.nix
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ in

    {
    environment.sessionVariables = {
    LOCALE_ARCHIVE_2_26 = "${oldpkgs.glibcLocales}/lib/locale/locale-archive";
    LOCALE_ARCHIVE_2_11 = "${newpkgs.glibcLocales}/lib/locale/locale-archive";
    LOCALE_ARCHIVE_2_11 = "${oldpkgs.glibcLocales}/lib/locale/locale-archive";
    LOCALE_ARCHIVE_2_27 = "${newpkgs.glibcLocales}/lib/locale/locale-archive";
    };
    }
  2. @peti peti revised this gist Jun 30, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    This NixOS code ensures that the system provide version-specific LOCALE_ARCHIVE
    This NixOS code ensures that the system provide version-specific `$LOCALE_ARCHIVE`
    environment variables to mitigate the effects of
    https://github.com/NixOS/nixpkgs/issues/38991.

  3. @peti peti revised this gist Jun 27, 2018. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -7,3 +7,15 @@ like `multi-glibc-locale-paths.nix`. Then edit your `configuration.nix` file to
    contain the attribute:

    imports = [ ./multi-glibc-locale-paths.nix ];

    If you are running Nix on a host system other than NixOS, you'll have to
    configure those environment variables manually:

    * Set `$LOCALE_ARCHIVE_2_27` to the path
    `"${glibcLocales}/lib/locale/locale-archive"`. You can find out what
    `glibcLocales` is by running:

    $ nix-build --no-out-link "<nixpkgs>" -A glibcLocales
    /nix/store/m53mq2077pfxhqf37gdbj7fkkdc1c8hc-glibc-locales-2.27

    * Set `$LOCALE_ARCHIVE_2_11` to the path of your system's locale.
  4. @peti peti revised this gist Jun 27, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion multi-glibc-locale-paths.nix
    Original file line number Diff line number Diff line change
    @@ -34,6 +34,6 @@ in
    {
    environment.sessionVariables = {
    LOCALE_ARCHIVE_2_26 = "${oldpkgs.glibcLocales}/lib/locale/locale-archive";
    LOCALE_ARCHIVE_2_27 = "${newpkgs.glibcLocales}/lib/locale/locale-archive";
    LOCALE_ARCHIVE_2_11 = "${newpkgs.glibcLocales}/lib/locale/locale-archive";
    };
    }
  5. @peti peti revised this gist Apr 25, 2018. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    This NixOS code ensures that the system provide version-specific LOCALE_ARCHIVE
    environment variables to mitigate the effects of
    https://github.com/NixOS/nixpkgs/issues/38991.

    To deploy it, copy the file into your `/etc/nixos` folder using a file name
    like `multi-glibc-locale-paths.nix`. Then edit your `configuration.nix` file to
    contain the attribute:

    imports = [ ./multi-glibc-locale-paths.nix ];
  6. @peti peti created this gist Apr 25, 2018.
    39 changes: 39 additions & 0 deletions multi-glibc-locale-paths.nix
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    { config, pkgs, ... }: # multi-glibc-locale-paths.nix

    /*
    * Provide version-specific LOCALE_ARCHIVE environment variables to mitigate
    * the effects of https://github.com/NixOS/nixpkgs/issues/38991.
    */

    let

    # A random Nixpkgs revision *before* the default glibc
    # was switched to version 2.27.x.
    oldpkgsSrc = pkgs.fetchFromGitHub {
    owner = "nixos";
    repo = "nixpkgs";
    rev = "0252e6ca31c98182e841df494e6c9c4fb022c676";
    sha256 = "1sr5a11sb26rgs1hmlwv5bxynw2pl5w4h5ic0qv3p2ppcpmxwykz";
    };

    oldpkgs = import oldpkgsSrc {};

    # A random Nixpkgs revision *after* the default glibc
    # was switched to version 2.27.x.
    newpkgsSrc = pkgs.fetchFromGitHub {
    owner = "nixos";
    repo = "nixpkgs";
    rev = "1d0a71879dac0226272212df7a2463d8eeb8f75b";
    sha256 = "0nh6wfw50lx6wkzyiscfqg6fl6rb17wmncj8jsdvbgmsd6rm95rg";
    };

    newpkgs = import newpkgsSrc {};

    in

    {
    environment.sessionVariables = {
    LOCALE_ARCHIVE_2_26 = "${oldpkgs.glibcLocales}/lib/locale/locale-archive";
    LOCALE_ARCHIVE_2_27 = "${newpkgs.glibcLocales}/lib/locale/locale-archive";
    };
    }