diff --git a/doc/erlang-users-guide.xml b/doc/erlang-users-guide.xml index 778d6e709b1..074ae50b1c0 100644 --- a/doc/erlang-users-guide.xml +++ b/doc/erlang-users-guide.xml @@ -3,6 +3,23 @@ xml:id="users-guide-to-the-erlang-infrastructure">
edns0
option in glibc
supports use of the extension mechanisms for
+ DNS (EDNS) specified in RFC 2671. The most popular user of that feature is DNSSEC,
+ which does not work without it.
+ '';
+ };
+
networking.extraResolvconfConf = lib.mkOption {
type = types.lines;
default = "";
@@ -162,7 +173,10 @@ in
libc_restart='${pkgs.systemd}/bin/systemctl try-restart --no-block nscd.service 2> /dev/null'
'' + optionalString cfg.dnsSingleRequest ''
# only send one DNS request at a time
- resolv_conf_options='single-request'
+ resolv_conf_options+=' single-request'
+ '' + optionalString cfg.dnsExtensionMechanism ''
+ # enable extension mechanisms for DNS
+ resolv_conf_options+=' edns0'
'' + optionalString hasLocalResolver ''
# This hosts runs a full-blown DNS resolver.
name_servers='127.0.0.1'
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index c590c4cde3f..2284eba07a2 100644
--- a/nixos/modules/installer/tools/nixos-generate-config.pl
+++ b/nixos/modules/installer/tools/nixos-generate-config.pl
@@ -148,7 +148,7 @@ sub pciCheck {
$device eq "0x4331" || $device eq "0x43a0" || $device eq "0x43b1"
) )
{
- push @modulePackages, "\${config.boot.kernelPackages.broadcom_sta}";
+ push @modulePackages, "config.boot.kernelPackages.broadcom_sta";
push @kernelModules, "wl";
}
@@ -422,13 +422,20 @@ EOF
# Generate the hardware configuration file.
-sub toNixExpr {
+sub toNixStringList {
my $res = "";
foreach my $s (@_) {
$res .= " \"$s\"";
}
return $res;
}
+sub toNixList {
+ my $res = "";
+ foreach my $s (@_) {
+ $res .= " $s";
+ }
+ return $res;
+}
sub multiLineList {
my $indent = shift;
@@ -444,9 +451,9 @@ sub multiLineList {
return $res;
}
-my $initrdAvailableKernelModules = toNixExpr(uniq @initrdAvailableKernelModules);
-my $kernelModules = toNixExpr(uniq @kernelModules);
-my $modulePackages = toNixExpr(uniq @modulePackages);
+my $initrdAvailableKernelModules = toNixStringList(uniq @initrdAvailableKernelModules);
+my $kernelModules = toNixStringList(uniq @kernelModules);
+my $modulePackages = toNixList(uniq @modulePackages);
my $fsAndSwap = "";
if (!$noFilesystems) {
diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh
index 6792690b4c3..105d1cd1625 100644
--- a/nixos/modules/installer/tools/nixos-rebuild.sh
+++ b/nixos/modules/installer/tools/nixos-rebuild.sh
@@ -19,6 +19,8 @@ rollback=
upgrade=
repair=
profile=/nix/var/nix/profiles/system
+buildHost=
+targetHost=
while [ "$#" -gt 0 ]; do
i="$1"; shift 1
@@ -73,6 +75,14 @@ while [ "$#" -gt 0 ]; do
fi
shift 1
;;
+ --build-host|h)
+ buildHost="$1"
+ shift 1
+ ;;
+ --target-host|t)
+ targetHost="$1"
+ shift 1
+ ;;
*)
echo "$0: unknown option \`$i'"
exit 1
@@ -80,6 +90,90 @@ while [ "$#" -gt 0 ]; do
esac
done
+
+if [ -z "$buildHost" -a -n "$targetHost" ]; then
+ buildHost="$targetHost"
+fi
+if [ "$targetHost" = localhost ]; then
+ targetHost=
+fi
+if [ "$buildHost" = localhost ]; then
+ buildHost=
+fi
+
+buildHostCmd() {
+ if [ -z "$buildHost" ]; then
+ "$@"
+ elif [ -n "$remoteNix" ]; then
+ ssh $SSHOPTS "$buildHost" PATH="$remoteNix:$PATH" "$@"
+ else
+ ssh $SSHOPTS "$buildHost" "$@"
+ fi
+}
+
+targetHostCmd() {
+ if [ -z "$targetHost" ]; then
+ "$@"
+ else
+ ssh $SSHOPTS "$targetHost" "$@"
+ fi
+}
+
+copyToTarget() {
+ if ! [ "$targetHost" = "$buildHost" ]; then
+ if [ -z "$targetHost" ]; then
+ NIX_SSHOPTS=$SSH_OPTS nix-copy-closure --from "$buildHost" "$1"
+ elif [ -z "$buildHost" ]; then
+ NIX_SSHOPTS=$SSH_OPTS nix-copy-closure --to "$targetHost" "$1"
+ else
+ buildHostCmd nix-copy-closure --to "$targetHost" "$1"
+ fi
+ fi
+}
+
+nixBuild() {
+ if [ -z "$buildHost" ]; then
+ nix-build "$@"
+ else
+ local instArgs=()
+ local buildArgs=()
+
+ while [ "$#" -gt 0 ]; do
+ local i="$1"; shift 1
+ case "$i" in
+ -o)
+ local out="$1"; shift 1
+ buildArgs+=("--add-root" "$out" "--indirect")
+ ;;
+ -A)
+ local j="$1"; shift 1
+ instArgs+=("$i" "$j")
+ ;;
+ -I)
+ # We don't want this in buildArgs
+ shift 1
+ ;;
+ "<"*) # nix paths
+ instArgs+=("$i")
+ ;;
+ *)
+ buildArgs+=("$i")
+ ;;
+ esac
+ done
+
+ local drv="$(nix-instantiate "${instArgs[@]}" "${extraBuildFlags[@]}")"
+ if [ -a "$drv" ]; then
+ NIX_SSHOPTS=$SSH_OPTS nix-copy-closure --to "$buildHost" "$drv"
+ buildHostCmd nix-store -r "$drv" "${buildArgs[@]}"
+ else
+ echo "nix-instantiate failed"
+ exit 1
+ fi
+ fi
+}
+
+
if [ -z "$action" ]; then showSyntax; fi
# Only run shell scripts from the Nixpkgs tree if the action is
@@ -128,7 +222,16 @@ fi
tmpDir=$(mktemp -t -d nixos-rebuild.XXXXXX)
-trap 'rm -rf "$tmpDir"' EXIT
+SSHOPTS="$NIX_SSHOPTS -o ControlMaster=auto -o ControlPath=$tmpDir/ssh-%n -o ControlPersist=60"
+
+cleanup() {
+ for ctrl in "$tmpDir"/ssh-*; do
+ ssh -o ControlPath="$ctrl" -O exit dummyhost 2>/dev/null || true
+ done
+ rm -rf "$tmpDir"
+}
+trap cleanup EXIT
+
# If the Nix daemon is running, then use it. This allows us to use
@@ -150,30 +253,56 @@ if [ -n "$rollback" -o "$action" = dry-build ]; then
buildNix=
fi
+prebuiltNix() {
+ machine="$1"
+ if [ "$machine" = x86_64 ]; then
+ return /nix/store/xryr9g56h8yjddp89d6dw12anyb4ch7c-nix-1.10
+ elif [[ "$machine" =~ i.86 ]]; then
+ return /nix/store/2w92k5wlpspf0q2k9mnf2z42prx3bwmv-nix-1.10
+ else
+ echo "$0: unsupported platform"
+ exit 1
+ fi
+}
+
+remotePATH=
+
if [ -n "$buildNix" ]; then
echo "building Nix..." >&2
- if ! nix-build 'In misc.
++In misc.
+ +Or completely awesome. Depends the needs.
+a root-relative link to markdown-article +@@ -58,7 +58,7 @@ pelican.conf, it will have nothing in default.
+ + 8 def run(self):
self.assert_has_content()
10 try:
lexer = get_lexer_by_name(self.arguments[0])
12 except ValueError:
# no lexer found - use the text one instead of an exception
14 lexer = TextLexer()
16 if ('linenos' in self.options and
self.options['linenos'] not in ('table', 'inline')):
18 self.options['linenos'] = 'table'
20 for flag in ('nowrap', 'nobackground', 'anchorlinenos'):
if flag in self.options:
22 self.options[flag] = True
24 # noclasses should already default to False, but just in case...
formatter = HtmlFormatter(noclasses=False, **self.options)
26 parsed = highlight('\n'.join(self.content), lexer, formatter)
return [nodes.raw('', parsed, format='html')]
8 def run(self):
self.assert_has_content()
10 try:
lexer = get_lexer_by_name(self.arguments[0])
12 except ValueError:
# no lexer found - use the text one instead of an exception
14 lexer = TextLexer()
16 if ('linenos' in self.options and
self.options['linenos'] not in ('table', 'inline')):
18 self.options['linenos'] = 'table'
20 for flag in ('nowrap', 'nobackground', 'anchorlinenos'):
if flag in self.options:
22 self.options[flag] = True
24 # noclasses should already default to False, but just in case...
formatter = HtmlFormatter(noclasses=False, **self.options)
26 parsed = highlight('\n'.join(self.content), lexer, formatter)
return [nodes.raw('', parsed, format='html')]
Lovely.
+