···744744 unittestFlags = [ "-s" "tests" "-v" ];
745745```
746746747747+##### Using sphinxHook {#using-sphinxhook}
748748+749749+The `sphinxHook` is a helpful tool to build documentation and manpages
750750+using the popular Sphinx documentation generator.
751751+It is setup to automatically find common documentation source paths and
752752+render them using the default `html` style.
753753+754754+```
755755+ outputs = [
756756+ "out"
757757+ "doc"
758758+ ];
759759+760760+ nativeBuildInputs = [
761761+ sphinxHook
762762+ ];
763763+```
764764+765765+The hook will automatically build and install the artifact into the
766766+`doc` output, if it exists. It also provides an automatic diversion
767767+for the artifacts of the `man` builder into the `man` target.
768768+769769+```
770770+ outputs = [
771771+ "out"
772772+ "doc"
773773+ "man"
774774+ ];
775775+776776+ # Use multiple builders
777777+ sphinxBuilders = [
778778+ "singlehtml"
779779+ "man"
780780+ ];
781781+```
782782+783783+Overwrite `sphinxRoot` when the hook is unable to find your
784784+documentation source root.
785785+786786+```
787787+ # Configure sphinxRoot for uncommon paths
788788+ sphinxRoot = "weird/docs/path";
789789+```
790790+791791+The hook is also available to packages outside the python ecosystem by
792792+referencing it using `python3.pkgs.sphinxHook`.
793793+747794### Develop local package {#develop-local-package}
748795749796As a Python developer you're likely aware of [development mode](http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode)
···12701317- `pytestCheckHook` to run tests with `pytest`. See [example usage](#using-pytestcheckhook).
12711318- `pythonCatchConflictsHook` to check whether a Python package is not already existing.
12721319- `pythonImportsCheckHook` to check whether importing the listed modules works.
13201320+- `pythonRelaxDepsHook` will relax Python dependencies restrictions for the package.
13211321+ See [example usage](#using-pythonrelaxdepshook).
12731322- `pythonRemoveBinBytecode` to remove bytecode from the `/bin` folder.
12741323- `setuptoolsBuildHook` to build a wheel using `setuptools`.
12751324- `setuptoolsCheckHook` to run tests with `python setup.py test`.
13251325+- `sphinxHook` to build documentation and manpages using Sphinx.
12761326- `venvShellHook` to source a Python 3 `venv` at the `venvDir` location. A
12771327 `venv` is created if it does not yet exist. `postVenvCreation` can be used to
12781328 to run commands only after venv is first created.
12791329- `wheelUnpackHook` to move a wheel to the correct folder so it can be installed
12801330 with the `pipInstallHook`.
12811281-- `pythonRelaxDepsHook` will relax Python dependencies restrictions for the package.
12821282- See [example usage](#using-pythonrelaxdepshook).
12831331- `unittestCheckHook` will run tests with `python -m unittest discover`. See [example usage](#using-unittestcheckhook).
1284133212851333### Development mode {#development-mode}
+2-2
nixos/modules/services/backup/sanoid.nix
···130130 type = types.attrsOf (types.submodule ({ config, options, ... }: {
131131 freeformType = datasetSettingsType;
132132 options = commonOptions // datasetOptions;
133133- config.use_template = mkAliasDefinitions (mkDefault options.useTemplate or { });
134134- config.process_children_only = mkAliasDefinitions (mkDefault options.processChildrenOnly or { });
133133+ config.use_template = modules.mkAliasAndWrapDefsWithPriority id (options.useTemplate or { });
134134+ config.process_children_only = modules.mkAliasAndWrapDefsWithPriority id (options.processChildrenOnly or { });
135135 }));
136136 default = { };
137137 description = lib.mdDoc "Datasets to snapshot.";
+12
nixos/tests/sanoid.nix
···3434 autosnap = true;
3535 };
3636 datasets."pool/sanoid".use_template = [ "test" ];
3737+ datasets."pool/compat".useTemplate = [ "test" ];
3738 extraArgs = [ "--verbose" ];
3839 };
3940···51525253 # Test pool without parent (regression test for https://github.com/NixOS/nixpkgs/pull/180111)
5354 "pool".target = "root@target:pool/full-pool";
5555+5656+ # Test backward compatible options (regression test for https://github.com/NixOS/nixpkgs/issues/181561)
5757+ "pool/compat" = {
5858+ target = "root@target:pool/compat";
5959+ extraArgs = [ "--no-sync-snap" ];
6060+ };
5461 };
5562 };
5663 };
···7077 "udevadm settle",
7178 "zpool create pool -R /mnt /dev/vdb1",
7279 "zfs create pool/sanoid",
8080+ "zfs create pool/compat",
7381 "zfs create pool/syncoid",
7482 "udevadm settle",
7583 )
···9410295103 # Take snapshot with sanoid
96104 source.succeed("touch /mnt/pool/sanoid/test.txt")
105105+ source.succeed("touch /mnt/pool/compat/test.txt")
97106 source.systemctl("start --wait sanoid.service")
9810799108 assert len(source.succeed("zfs allow pool")) == 0, "Pool shouldn't have delegated permissions set after snapshotting"
···110119111120 source.systemctl("start --wait syncoid-pool.service")
112121 target.succeed("[[ -d /mnt/pool/full-pool/syncoid ]]")
122122+123123+ source.systemctl("start --wait syncoid-pool-compat.service")
124124+ target.succeed("cat /mnt/pool/compat/test.txt")
113125114126 assert len(source.succeed("zfs allow pool")) == 0, "Pool shouldn't have delegated permissions set after syncing snapshots"
115127 assert len(source.succeed("zfs allow pool/sanoid")) == 0, "Sanoid dataset shouldn't have delegated permissions set after syncing snapshots"
···88 # N.B. Versions in this list should be ordered from newest to oldest.
99 [
1010 {
1111+ version = "13.1.0";
1212+ lang = "en";
1313+ language = "English";
1414+ sha256 = "1659kyp38a8xknic95pynx9fsgn96i8jn9lnk89pc8n6vydw1460";
1515+ installer = "WolframEngine_13.1.0_LINUX.sh";
1616+ }
1717+ {
1118 version = "13.0.1";
1219 lang = "en";
1320 language = "English";
···5757, libdvdcss
5858, libbluray
5959 # Darwin-specific
6060-, AudioToolbox ? null
6161-, Foundation ? null
6262-, libobjc ? null
6363-, VideoToolbox ? null
6060+, AudioToolbox
6161+, Foundation
6262+, libobjc
6363+, VideoToolbox
6464 # GTK
6565 # NOTE: 2019-07-19: The gtk3 package has a transitive dependency on dbus,
6666 # which in turn depends on systemd. systemd is not supported on Darwin, so
···11-# This hook automatically finds Sphinx documentation, builds it in html format
22-# and installs it.
33-#
44-# This hook knows about several popular locations in which subdirectory
55-# documentation may be, but in very unusual cases $sphinxRoot directory can be
66-# set explicitly.
77-#
88-# Name of the directory relative to ${doc:-$out}/share/doc is normally also
99-# deduced automatically, but can be overridden with $sphinxOutdir variable.
1010-#
1111-# Sphinx build system can depend on arbitrary amount of python modules, client
1212-# code is responsible for ensuring that all dependencies are present.
11+# shellcheck shell=bash
22+echo "Sourcing sphinx-hook"
33+44+declare -a __sphinxBuilders
135146buildSphinxPhase() {
1515- local __sphinxRoot="" o
77+ echo "Executing buildSphinxPhase"
16899+ local __sphinxRoot=""
1710 runHook preBuildSphinx
1111+1812 if [[ -n "${sphinxRoot:-}" ]] ; then # explicit root
1913 if ! [[ -f "${sphinxRoot}/conf.py" ]] ; then
2014 echo 2>&1 "$sphinxRoot/conf.py: no such file"
···2216 fi
2317 __sphinxRoot=$sphinxRoot
2418 else
2525- for o in doc docs doc/source docs/source ; do
2626- if [[ -f "$o/conf.py" ]] ; then
2727- echo "Sphinx documentation found in $o"
2828- __sphinxRoot=$o
1919+ for candidate in doc docs doc/source docs/source ; do
2020+ if [[ -f "$candidate/conf.py" ]] ; then
2121+ echo "Sphinx documentation found in $candidate"
2222+ __sphinxRoot=$candidate
2923 break
3024 fi
3125 done
···3529 echo 2>&1 "Sphinx documentation not found, use 'sphinxRoot' variable"
3630 exit 1
3731 fi
3838- sphinx-build -M html "${__sphinxRoot}" ".sphinx/html" -v
3232+3333+ if [ -n "${sphinxBuilders-}" ]; then
3434+ eval "__sphinxBuilders=($sphinxBuilders)"
3535+ else
3636+ __sphinxBuilders=(html)
3737+ fi
3838+3939+ for __builder in "${__sphinxBuilders[@]}"; do
4040+ echo "Executing sphinx-build with ${__builder} builder"
4141+ sphinx-build -M "${__builder}" "${__sphinxRoot}" ".sphinx/${__builder}" -v
4242+ done
39434044 runHook postBuildSphinx
4145}
42464347installSphinxPhase() {
4848+ echo "Executing installSphinxPhase"
4949+4450 local docdir=""
4551 runHook preInstallSphinx
46524747- docdir="${doc:-$out}/share/doc/${sphinxOutdir:-$name}"
4848- mkdir -p "$docdir"
5353+ for __builder in "${__sphinxBuilders[@]}"; do
5454+ # divert output for man builder
5555+ if [ "$__builder" == "man" ]; then
5656+ installManPage .sphinx/man/man/*
5757+5858+ else
5959+ # shellcheck disable=2154
6060+ docdir="${doc:-$out}/share/doc/${pname}"
49615050- cp -r .sphinx/html/html "$docdir/"
5151- rm -fr "${docdir}/html/_sources" "${docdir}/html/.buildinfo"
6262+ mkdir -p "$docdir"
6363+6464+ cp -r ".sphinx/${__builder}/${__builder}" "$docdir/"
6565+ rm -fr "${docdir}/${__builder}/_sources" "${docdir}/${__builder}/.buildinfo"
6666+ fi
6767+ done
52685369 runHook postInstallSphinx
5470}
55715656-preDistPhases+=" buildSphinxPhase"
5757-postPhases+=" installSphinxPhase"
7272+preDistPhases+=" buildSphinxPhase installSphinxPhase"
···11# The actual Plex package that we run is a FHS userenv of the "raw" package.
22{ stdenv
33-, buildFHSUserEnv
33+, buildFHSUserEnvBubblewrap
44, writeScript
55, plexRaw
66···99, dataDir ? "/var/lib/plex"
1010}:
11111212-buildFHSUserEnv {
1212+buildFHSUserEnvBubblewrap {
1313 name = "plexmediaserver";
1414+1415 inherit (plexRaw) meta;
1616+1717+ # Plex does some magic to detect if it is already running.
1818+ # The separate PID namespace somehow breaks this and Plex is thinking it's already
1919+ # running and refuses to start.
2020+ unsharePid = false;
15211622 # This script is run when we start our Plex binary
1723 runScript = writeScript "plex-run-script" ''