mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
Merge remote-tracking branch 'origin/staging-next' into staging
This commit is contained in:
commit
49db95baf5
96 changed files with 1586 additions and 23977 deletions
|
@ -49,6 +49,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
minBrightness = lib.mkOption {
|
||||
type = lib.types.numbers.between 0 100;
|
||||
default = 0.1;
|
||||
description = ''
|
||||
The minimum authorized brightness value, e.g. to avoid the
|
||||
display going dark.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -63,13 +72,14 @@ in
|
|||
let
|
||||
light = "${pkgs.light}/bin/light";
|
||||
step = builtins.toString cfg.brightnessKeys.step;
|
||||
minBrightness = builtins.toString cfg.brightnessKeys.minBrightness;
|
||||
in
|
||||
[
|
||||
{
|
||||
keys = [ 224 ];
|
||||
events = [ "key" ];
|
||||
# Use minimum brightness 0.1 so the display won't go totally black.
|
||||
command = "${light} -N 0.1 && ${light} -U ${step}";
|
||||
# -N is used to ensure that value >= minBrightness
|
||||
command = "${light} -N ${minBrightness} && ${light} -U ${step}";
|
||||
}
|
||||
{
|
||||
keys = [ 225 ];
|
||||
|
|
|
@ -26,7 +26,6 @@ let
|
|||
substring
|
||||
versionOlder
|
||||
|
||||
fileContents
|
||||
readFile
|
||||
|
||||
literalExpression
|
||||
|
@ -129,17 +128,18 @@ let
|
|||
in replaceSec' { };
|
||||
|
||||
# Erlang/Elixir uses a somewhat special format for IP addresses
|
||||
erlAddr = addr: fileContents
|
||||
(pkgs.runCommand addr {
|
||||
nativeBuildInputs = [ cfg.package.elixirPackage ];
|
||||
code = ''
|
||||
case :inet.parse_address('${addr}') do
|
||||
{:ok, addr} -> IO.inspect addr
|
||||
{:error, _} -> System.halt(65)
|
||||
end
|
||||
'';
|
||||
passAsFile = [ "code" ];
|
||||
} ''elixir "$codePath" >"$out"'');
|
||||
erlAddr = addr:
|
||||
let
|
||||
isIPv4 = (lib.match "^([0-9]+\\.){3}[0-9]+$" addr) != null;
|
||||
in
|
||||
if isIPv4 then
|
||||
"{${lib.concatStringsSep "," (lib.splitString "." addr)}}"
|
||||
else
|
||||
let
|
||||
inherit (lib.network.ipv6.fromString addr) address;
|
||||
parsed = lib.map (x: "16#${x}") (lib.splitString ":" address);
|
||||
in
|
||||
"{${lib.concatStringsSep "," parsed}}";
|
||||
|
||||
configFile = format.generate "config.exs"
|
||||
(replaceSec
|
||||
|
@ -327,11 +327,11 @@ let
|
|||
AKKOMA_CONFIG_PATH="''${RUNTIME_DIRECTORY%%:*}/config.exs" \
|
||||
ERL_EPMD_ADDRESS="${cfg.dist.address}" \
|
||||
ERL_EPMD_PORT="${toString cfg.dist.epmdPort}" \
|
||||
ERL_FLAGS=${escapeShellArg (escapeShellArgs ([
|
||||
ERL_FLAGS="${escapeShellArgs ([
|
||||
"-kernel" "inet_dist_use_interface" (erlAddr cfg.dist.address)
|
||||
"-kernel" "inet_dist_listen_min" (toString cfg.dist.portMin)
|
||||
"-kernel" "inet_dist_listen_max" (toString cfg.dist.portMax)
|
||||
] ++ cfg.dist.extraFlags))} \
|
||||
] ++ cfg.dist.extraFlags)}" \
|
||||
RELEASE_COOKIE="$(<"''${RUNTIME_DIRECTORY%%:*}/cookie")" \
|
||||
RELEASE_NAME="akkoma" \
|
||||
exec "${cfg.package}/bin/$(basename "$0")" "$@"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue