mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00
nixos/environment.memoryAllocator: remove with lib;
This commit is contained in:
parent
88e6e9d4ac
commit
dd7e20e16a
1 changed files with 6 additions and 8 deletions
|
@ -1,6 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.environment.memoryAllocator;
|
cfg = config.environment.memoryAllocator;
|
||||||
|
|
||||||
|
@ -85,12 +83,12 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
meta = {
|
meta = {
|
||||||
maintainers = [ maintainers.joachifm ];
|
maintainers = [ lib.maintainers.joachifm ];
|
||||||
};
|
};
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
environment.memoryAllocator.provider = mkOption {
|
environment.memoryAllocator.provider = lib.mkOption {
|
||||||
type = types.enum ([ "libc" ] ++ attrNames providers);
|
type = lib.types.enum ([ "libc" ] ++ lib.attrNames providers);
|
||||||
default = "libc";
|
default = "libc";
|
||||||
description = ''
|
description = ''
|
||||||
The system-wide memory allocator.
|
The system-wide memory allocator.
|
||||||
|
@ -98,8 +96,8 @@ in
|
||||||
Briefly, the system-wide memory allocator providers are:
|
Briefly, the system-wide memory allocator providers are:
|
||||||
|
|
||||||
- `libc`: the standard allocator provided by libc
|
- `libc`: the standard allocator provided by libc
|
||||||
${concatStringsSep "\n" (mapAttrsToList
|
${lib.concatStringsSep "\n" (lib.mapAttrsToList
|
||||||
(name: value: "- `${name}`: ${replaceStrings [ "\n" ] [ " " ] value.description}")
|
(name: value: "- `${name}`: ${lib.replaceStrings [ "\n" ] [ " " ] value.description}")
|
||||||
providers)}
|
providers)}
|
||||||
|
|
||||||
::: {.warning}
|
::: {.warning}
|
||||||
|
@ -111,7 +109,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.provider != "libc") {
|
config = lib.mkIf (cfg.provider != "libc") {
|
||||||
environment.etc."ld-nix.so.preload".text = ''
|
environment.etc."ld-nix.so.preload".text = ''
|
||||||
${providerLibPath}
|
${providerLibPath}
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue