···56```ShellSession
7$ nix-build nixos/tests/login.nix -A driverInteractive
8-$ ./result/bin/nixos-test-driver
9starting VDE switch for network 1
10>
11```
···24you to inspect the state of the VMs after the test (e.g. to debug the
25test script).
2627-To just start and experiment with the VMs, run:
28-29-```ShellSession
30-$ nix-build nixos/tests/login.nix -A driverInteractive
31-$ ./result/bin/nixos-run-vms
32-```
33-34-The script `nixos-run-vms` starts the virtual machines defined by test.
35-36You can re-use the VM states coming from a previous run by setting the
37`--keep-vm-state` flag.
3839```ShellSession
40-$ ./result/bin/nixos-run-vms --keep-vm-state
41```
4243The machine state is stored in the `$TMPDIR/vm-state-machinename`
···56```ShellSession
7$ nix-build nixos/tests/login.nix -A driverInteractive
8+$ ./result/bin/nixos-test-driver --interactive
9starting VDE switch for network 1
10>
11```
···24you to inspect the state of the VMs after the test (e.g. to debug the
25test script).
2600000000027You can re-use the VM states coming from a previous run by setting the
28`--keep-vm-state` flag.
2930```ShellSession
31+$ ./result/bin/nixos-test-driver --interactive --keep-vm-state
32```
3334The machine state is stored in the `$TMPDIR/vm-state-machinename`
···6 </para>
7 <programlisting>
8$ nix-build nixos/tests/login.nix -A driverInteractive
9-$ ./result/bin/nixos-test-driver
10starting VDE switch for network 1
11>
12</programlisting>
···26 the test (e.g. to debug the test script).
27 </para>
28 <para>
29- To just start and experiment with the VMs, run:
30- </para>
31- <programlisting>
32-$ nix-build nixos/tests/login.nix -A driverInteractive
33-$ ./result/bin/nixos-run-vms
34-</programlisting>
35- <para>
36- The script <literal>nixos-run-vms</literal> starts the virtual
37- machines defined by test.
38- </para>
39- <para>
40 You can re-use the VM states coming from a previous run by setting
41 the <literal>--keep-vm-state</literal> flag.
42 </para>
43 <programlisting>
44-$ ./result/bin/nixos-run-vms --keep-vm-state
45</programlisting>
46 <para>
47 The machine state is stored in the
···6 </para>
7 <programlisting>
8$ nix-build nixos/tests/login.nix -A driverInteractive
9+$ ./result/bin/nixos-test-driver --interactive
10starting VDE switch for network 1
11>
12</programlisting>
···26 the test (e.g. to debug the test script).
27 </para>
28 <para>
0000000000029 You can re-use the VM states coming from a previous run by setting
30 the <literal>--keep-vm-state</literal> flag.
31 </para>
32 <programlisting>
33+$ ./result/bin/nixos-test-driver --interactive --keep-vm-state
34</programlisting>
35 <para>
36 The machine state is stored in the
+73-28
nixos/lib/test-driver/test-driver.py
···24import telnetlib
25import tempfile
26import time
27-import traceback
28import unicodedata
2930CHAR_TO_KEY = {
···930 machine.wait_for_shutdown()
931932933-def test_script() -> None:
934- exec(os.environ["testScript"])
935-936-937-def run_tests() -> None:
938 global machines
939- tests = os.environ.get("tests", None)
940- if tests is not None:
941- with log.nested("running the VM test script"):
942- try:
943- exec(tests, globals())
944- except Exception as e:
945- eprint("error: ")
946- traceback.print_exc()
947- sys.exit(1)
948 else:
949- ptpython.repl.embed(locals(), globals())
950-951- # TODO: Collect coverage data
952-953- for machine in machines:
954- if machine.is_up():
955- machine.execute("sync")
956957958def serial_stdout_on() -> None:
···965 log._print_serial_logs = False
9669670000000000000000000000000968@contextmanager
969def subtest(name: str) -> Iterator[None]:
970 with log.nested(name):
···986 help="re-use a VM state coming from a previous run",
987 action="store_true",
988 )
989- (cli_args, vm_scripts) = arg_parser.parse_known_args()
00000000000000000000000000000000000990991 log = Logger()
992993- vlan_nrs = list(dict.fromkeys(os.environ.get("VLANS", "").split()))
994- vde_sockets = [create_vlan(v) for v in vlan_nrs]
995 for nr, vde_socket, _, _ in vde_sockets:
996 os.environ["QEMU_VDE_SOCKET_{}".format(nr)] = vde_socket
997998 machines = [
999- create_machine({"startCommand": s, "keepVmState": cli_args.keep_vm_state})
1000- for s in vm_scripts
1001 ]
1002 machine_eval = [
1003 "{0} = machines[{1}]".format(m.name, idx) for idx, m in enumerate(machines)
···1017 log.close()
10181019 tic = time.time()
1020- run_tests()
1021 toc = time.time()
1022 print("test script finished in {:.2f}s".format(toc - tic))
···24import telnetlib
25import tempfile
26import time
027import unicodedata
2829CHAR_TO_KEY = {
···929 machine.wait_for_shutdown()
930931932+def run_tests(interactive: bool = False) -> None:
0000933 global machines
934+ if interactive:
935+ ptpython.repl.embed(globals(), locals())
0000000936 else:
937+ test_script()
938+ # TODO: Collect coverage data
939+ for machine in machines:
940+ if machine.is_up():
941+ machine.execute("sync")
00942943944def serial_stdout_on() -> None:
···951 log._print_serial_logs = False
952953954+class EnvDefault(argparse.Action):
955+ """An argpars Action that takes values from the specified
956+ environment variable as the flags default value.
957+ """
958+959+ def __init__(self, envvar, required=False, default=None, nargs=None, **kwargs): # type: ignore
960+ if not default and envvar:
961+ if envvar in os.environ:
962+ if nargs is not None and (nargs.isdigit() or nargs in ["*", "+"]):
963+ default = os.environ[envvar].split()
964+ else:
965+ default = os.environ[envvar]
966+ kwargs["help"] = (
967+ kwargs["help"] + f" (default from environment: {default})"
968+ )
969+ if required and default:
970+ required = False
971+ super(EnvDefault, self).__init__(
972+ default=default, required=required, nargs=nargs, **kwargs
973+ )
974+975+ def __call__(self, parser, namespace, values, option_string=None): # type: ignore
976+ setattr(namespace, self.dest, values)
977+978+979@contextmanager
980def subtest(name: str) -> Iterator[None]:
981 with log.nested(name):
···997 help="re-use a VM state coming from a previous run",
998 action="store_true",
999 )
1000+ arg_parser.add_argument(
1001+ "-I",
1002+ "--interactive",
1003+ help="drop into a python repl and run the tests interactively",
1004+ action="store_true",
1005+ )
1006+ arg_parser.add_argument(
1007+ "--start-scripts",
1008+ metavar="START-SCRIPT",
1009+ action=EnvDefault,
1010+ envvar="startScripts",
1011+ nargs="*",
1012+ help="start scripts for participating virtual machines",
1013+ )
1014+ arg_parser.add_argument(
1015+ "--vlans",
1016+ metavar="VLAN",
1017+ action=EnvDefault,
1018+ envvar="vlans",
1019+ nargs="*",
1020+ help="vlans to span by the driver",
1021+ )
1022+ arg_parser.add_argument(
1023+ "testscript",
1024+ action=EnvDefault,
1025+ envvar="testScript",
1026+ help="the test script to run",
1027+ type=pathlib.Path,
1028+ )
1029+1030+ args = arg_parser.parse_args()
1031+ global test_script
1032+1033+ def test_script() -> None:
1034+ with log.nested("running the VM test script"):
1035+ exec(pathlib.Path(args.testscript).read_text(), globals())
10361037 log = Logger()
10381039+ vde_sockets = [create_vlan(v) for v in args.vlans]
01040 for nr, vde_socket, _, _ in vde_sockets:
1041 os.environ["QEMU_VDE_SOCKET_{}".format(nr)] = vde_socket
10421043 machines = [
1044+ create_machine({"startCommand": s, "keepVmState": args.keep_vm_state})
1045+ for s in args.start_scripts
1046 ]
1047 machine_eval = [
1048 "{0} = machines[{1}]".format(m.name, idx) for idx, m in enumerate(machines)
···1062 log.close()
10631064 tic = time.time()
1065+ run_tests(args.interactive)
1066 toc = time.time()
1067 print("test script finished in {:.2f}s".format(toc - tic))
···1{ lib, stdenv, fetchurl
2+, perl, gmp, mpfr, flint, boost
3, bliss, ppl, singular, cddlib, lrs, nauty
4+, ninja, ant, openjdk
5, perlPackages
6, makeWrapper
7}:
8+9+# polymake compiles its own version of sympol and atint because we
10+# don't have those packages. other missing optional dependencies:
11+# javaview, libnormaliz, scip, soplex, jreality.
1213stdenv.mkDerivation rec {
14 pname = "polymake";
15+ version = "4.4";
1617 src = fetchurl {
18+ # "The minimal version is a packager friendly version which omits
19+ # the bundled sources of cdd, lrs, libnormaliz, nauty and jReality."
20+ url = "https://polymake.org/lib/exe/fetch.php/download/polymake-${version}-minimal.tar.bz2";
21+ sha256 = "sha256-2nF5F2xznI77pl2TslrxA8HLpw4fmzVnPOM8N3kOwJE=";
22 };
2324 buildInputs = [
25+ perl gmp mpfr flint boost
26 bliss ppl singular cddlib lrs nauty
27 openjdk
28+ ] ++ (with perlPackages; [
29+ JSON TermReadLineGnu TermReadKey XMLSAX
030 ]);
3132 nativeBuildInputs = [
···41 done
42 '';
4344+ meta = with lib; {
45 description = "Software for research in polyhedral geometry";
46+ license = licenses.gpl2Plus;
47+ maintainers = teams.sage.members;
48+ platforms = platforms.linux;
49 homepage = "https://www.polymake.org/doku.php";
50 };
51}
+41
pkgs/data/fonts/vista-fonts-cht/default.nix
···00000000000000000000000000000000000000000
···1+{ lib, stdenvNoCC, fetchurl, cabextract }:
2+3+stdenvNoCC.mkDerivation {
4+ pname = "vista-fonts-cht";
5+ version = "1";
6+7+ src = fetchurl {
8+ url = https://download.microsoft.com/download/7/6/b/76bd7a77-be02-47f3-8472-fa1de7eda62f/VistaFont_CHT.EXE;
9+ sha256 = "sha256-fSnbbxlMPzbhFSQyKxQaS5paiWji8njK7tS8Eppsj6g=";
10+ };
11+12+ nativeBuildInputs = [ cabextract ];
13+14+ unpackPhase = ''
15+ cabextract --lowercase --filter '*.TTF' $src
16+ '';
17+18+ installPhase = ''
19+ mkdir -p $out/share/fonts/truetype
20+ cp *.ttf $out/share/fonts/truetype
21+22+ # Set up no-op font configs to override any aliases set up by
23+ # other packages.
24+ mkdir -p $out/etc/fonts/conf.d
25+ substitute ${./no-op.conf} $out/etc/fonts/conf.d/30-msjhenghei.conf \
26+ --subst-var-by fontname "Microsoft JhengHei"
27+ '';
28+29+30+ meta = with lib; {
31+ description = "TrueType fonts from Microsoft Windows Vista For Traditional Chinese (Microsoft JhengHei)";
32+ homepage = "https://www.microsoft.com/typography/fonts/family.aspx";
33+ license = licenses.unfree;
34+ maintainers = with maintainers; [ atkinschang ];
35+36+ # Set a non-zero priority to allow easy overriding of the
37+ # fontconfig configuration files.
38+ priority = 5;
39+ platforms = platforms.all;
40+ };
41+}
+9
pkgs/data/fonts/vista-fonts-cht/no-op.conf
···000000000
···1+<?xml version="1.0" encoding="UTF-8"?>
2+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
3+<fontconfig>
4+ <!-- This configuation is intentionally left empty in order to
5+ override any other font package that may wish to set up an
6+ alias for the Microsoft @fontname@ font. If you actually do
7+ want to have the alias then please change the priority of that
8+ package; see the Nix manual page for nix-env for details. -->
9+</fontconfig>
···70 # If you need a grammar that already exists in the official orga,
71 # make sure to give it a different name.
72 otherGrammars = {
000073 "tree-sitter-nix" = {
74 orga = "cstrahan";
75 repo = "tree-sitter-nix";
···105 "tree-sitter-zig" = {
106 orga = "GrayJack";
107 repo = "tree-sitter-zig";
0000108 };
109 };
110
···70 # If you need a grammar that already exists in the official orga,
71 # make sure to give it a different name.
72 otherGrammars = {
73+ "tree-sitter-comment" = {
74+ orga = "stsewd";
75+ repo = "tree-sitter-comment";
76+ };
77 "tree-sitter-nix" = {
78 orga = "cstrahan";
79 repo = "tree-sitter-nix";
···109 "tree-sitter-zig" = {
110 orga = "GrayJack";
111 repo = "tree-sitter-zig";
112+ };
113+ "tree-sitter-fish" = {
114+ orga = "ram02z";
115+ repo = "tree-sitter-fish";
116 };
117 };
118
···709 redkite = throw "redkite was archived by upstream"; # added 2021-04-12
710 rkt = throw "rkt was archived by upstream"; # added 2020-05-16
711 rpiboot-unstable = rpiboot; # added 2021-07-30
0712 ruby_2_0_0 = throw "ruby_2_0_0 was deprecated on 2018-02-13: use a newer version of ruby";
713 ruby_2_1_0 = throw "ruby_2_1_0 was deprecated on 2018-02-13: use a newer version of ruby";
714 ruby_2_2_9 = throw "ruby_2_2_9 was deprecated on 2018-02-13: use a newer version of ruby";
···709 redkite = throw "redkite was archived by upstream"; # added 2021-04-12
710 rkt = throw "rkt was archived by upstream"; # added 2020-05-16
711 rpiboot-unstable = rpiboot; # added 2021-07-30
712+ rtv = throw "rtv was archived by upstream. Consider using tuir, an actively maintained fork"; # added 2021-08-08
713 ruby_2_0_0 = throw "ruby_2_0_0 was deprecated on 2018-02-13: use a newer version of ruby";
714 ruby_2_1_0 = throw "ruby_2_1_0 was deprecated on 2018-02-13: use a newer version of ruby";
715 ruby_2_2_9 = throw "ruby_2_2_9 was deprecated on 2018-02-13: use a newer version of ruby";