diff options
Diffstat (limited to 'nixpkgs/nixos/lib')
-rw-r--r-- | nixpkgs/nixos/lib/eval-config.nix | 4 | ||||
-rw-r--r-- | nixpkgs/nixos/lib/make-options-doc/default.nix | 4 | ||||
-rw-r--r-- | nixpkgs/nixos/lib/test-driver/test-driver.py | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/nixpkgs/nixos/lib/eval-config.nix b/nixpkgs/nixos/lib/eval-config.nix index 9892d6f160f7..c8824c2690d3 100644 --- a/nixpkgs/nixos/lib/eval-config.nix +++ b/nixpkgs/nixos/lib/eval-config.nix @@ -61,7 +61,7 @@ in rec { args = extraArgs; specialArgs = { modulesPath = builtins.toString ../modules; } // specialArgs; - }) config options; + }) config options _module; # These are the extra arguments passed to every module. In # particular, Nixpkgs is passed through the "pkgs" argument. @@ -69,5 +69,5 @@ in rec { inherit baseModules extraModules modules; }; - inherit (config._module.args) pkgs; + inherit (_module.args) pkgs; } diff --git a/nixpkgs/nixos/lib/make-options-doc/default.nix b/nixpkgs/nixos/lib/make-options-doc/default.nix index eee8f612410d..e5813d9a3ef9 100644 --- a/nixpkgs/nixos/lib/make-options-doc/default.nix +++ b/nixpkgs/nixos/lib/make-options-doc/default.nix @@ -133,6 +133,7 @@ in { optionsJSON = pkgs.runCommand "options.json" { meta.description = "List of NixOS options in JSON format"; + buildInputs = [ pkgs.brotli ]; } '' # Export list of options in different format. @@ -141,8 +142,11 @@ in { cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsNix))} $dst/options.json + brotli -9 < $dst/options.json > $dst/options.json.br + mkdir -p $out/nix-support echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products + echo "file json-br $dst/options.json.br" >> $out/nix-support/hydra-build-products ''; # */ optionsDocBook = pkgs.runCommand "options-docbook.xml" {} '' diff --git a/nixpkgs/nixos/lib/test-driver/test-driver.py b/nixpkgs/nixos/lib/test-driver/test-driver.py index c27947bc610d..7825025893d3 100644 --- a/nixpkgs/nixos/lib/test-driver/test-driver.py +++ b/nixpkgs/nixos/lib/test-driver/test-driver.py @@ -6,6 +6,7 @@ from xml.sax.saxutils import XMLGenerator import _thread import atexit import base64 +import codecs import os import pathlib import ptpython.repl @@ -115,6 +116,7 @@ def create_vlan(vlan_nr: str) -> Tuple[str, str, "subprocess.Popen[bytes]", Any] fd.write("version\n") # TODO: perl version checks if this can be read from # an if not, dies. we could hang here forever. Fix it. + assert vde_process.stdout is not None vde_process.stdout.readline() if not os.path.exists(os.path.join(vde_socket, "ctl")): raise Exception("cannot start vde_switch") @@ -139,7 +141,7 @@ def retry(fn: Callable) -> None: class Logger: def __init__(self) -> None: self.logfile = os.environ.get("LOGFILE", "/dev/null") - self.logfile_handle = open(self.logfile, "wb") + self.logfile_handle = codecs.open(self.logfile, "wb") self.xml = XMLGenerator(self.logfile_handle, encoding="utf-8") self.queue: "Queue[Dict[str, str]]" = Queue(1000) @@ -739,6 +741,7 @@ class Machine: self.shell, _ = self.shell_socket.accept() def process_serial_output() -> None: + assert self.process.stdout is not None for _line in self.process.stdout: # Ignore undecodable bytes that may occur in boot menus line = _line.decode(errors="ignore").replace("\r", "").rstrip() |