···3535 };
3636 port = mkOption {
3737 type = types.nullOr port;
3838- description = lib.mdDoc "Port number.";
3838+ description = lib.mdDoc ''
3939+ Port number to listen on.
4040+ If unset and the listen address is not a socket then nginx defaults to 80.
4141+ '';
3942 default = null;
4043 };
4144 ssl = mkOption {
···379379 # Update the start menu for each user that is currently logged in
380380 system.userActivationScripts.plasmaSetup = activationScript;
381381382382- programs.firefox.wrapperConfig.enablePlasmaBrowserIntegration = true;
382382+ programs.firefox.nativeMessagingHosts.packages = [ pkgs.plasma5Packages.plasma-browser-integration ];
383383 })
384384385385 (mkIf (cfg.kwinrc != {}) {
···198198 fi
199199 ''}
200200201201+ ${lib.optionalString cfg.tpm.enable ''
202202+ NIX_SWTPM_DIR=$(readlink -f "''${NIX_SWTPM_DIR:-${config.system.name}-swtpm}")
203203+ mkdir -p "$NIX_SWTPM_DIR"
204204+ ${lib.getExe cfg.tpm.package} \
205205+ socket \
206206+ --tpmstate dir="$NIX_SWTPM_DIR" \
207207+ --ctrl type=unixio,path="$NIX_SWTPM_DIR"/socket,terminate \
208208+ --pid file="$NIX_SWTPM_DIR"/pid --daemon \
209209+ --tpm2 \
210210+ --log file="$NIX_SWTPM_DIR"/stdout,level=6
211211+212212+ # Enable `fdflags` builtin in Bash
213213+ # We will need it to perform surgical modification of the file descriptor
214214+ # passed in the coprocess to remove `FD_CLOEXEC`, i.e. close the file descriptor
215215+ # on exec.
216216+ # If let alone, it will trigger the coprocess to read EOF when QEMU is `exec`
217217+ # at the end of this script. To work around that, we will just clear
218218+ # the `FD_CLOEXEC` bits as a first step.
219219+ enable -f ${hostPkgs.bash}/lib/bash/fdflags fdflags
220220+ # leave a dangling subprocess because the swtpm ctrl socket has
221221+ # "terminate" when the last connection disconnects, it stops swtpm.
222222+ # When qemu stops, or if the main shell process ends, the coproc will
223223+ # get signaled by virtue of the pipe between main and coproc ending.
224224+ # Which in turns triggers a socat connect-disconnect to swtpm which
225225+ # will stop it.
226226+ coproc waitingswtpm {
227227+ read || :
228228+ echo "" | ${lib.getExe hostPkgs.socat} STDIO UNIX-CONNECT:"$NIX_SWTPM_DIR"/socket
229229+ }
230230+ # Clear `FD_CLOEXEC` on the coprocess' file descriptor stdin.
231231+ fdflags -s-cloexec ''${waitingswtpm[1]}
232232+ ''}
233233+201234 cd "$TMPDIR"
202235203236 ${lib.optionalString (cfg.emptyDiskImages != []) "idx=0"}
···863896 };
864897 };
865898899899+ virtualisation.tpm = {
900900+ enable = mkEnableOption "a TPM device in the virtual machine with a driver, using swtpm.";
901901+902902+ package = mkPackageOptionMD cfg.host.pkgs "swtpm" { };
903903+904904+ deviceModel = mkOption {
905905+ type = types.str;
906906+ default = ({
907907+ "i686-linux" = "tpm-tis";
908908+ "x86_64-linux" = "tpm-tis";
909909+ "ppc64-linux" = "tpm-spapr";
910910+ "armv7-linux" = "tpm-tis-device";
911911+ "aarch64-linux" = "tpm-tis-device";
912912+ }.${pkgs.hostPlatform.system} or (throw "Unsupported system for TPM2 emulation in QEMU"));
913913+ defaultText = ''
914914+ Based on the guest platform Linux system:
915915+916916+ - `tpm-tis` for (i686, x86_64)
917917+ - `tpm-spapr` for ppc64
918918+ - `tpm-tis-device` for (armv7, aarch64)
919919+ '';
920920+ example = "tpm-tis-device";
921921+ description = lib.mdDoc "QEMU device model for the TPM, uses the appropriate default based on th guest platform system and the package passed.";
922922+ };
923923+ };
924924+866925 virtualisation.useDefaultFilesystems =
867926 mkOption {
868927 type = types.bool;
···1028108710291088 boot.initrd.availableKernelModules =
10301089 optional cfg.writableStore "overlay"
10311031- ++ optional (cfg.qemu.diskInterface == "scsi") "sym53c8xx";
10901090+ ++ optional (cfg.qemu.diskInterface == "scsi") "sym53c8xx"
10911091+ ++ optional (cfg.tpm.enable) "tpm_tis";
1032109210331093 virtualisation.additionalPaths = [ config.system.build.toplevel ];
10341094···10981158 ])
10991159 (mkIf (!cfg.graphics) [
11001160 "-nographic"
11611161+ ])
11621162+ (mkIf (cfg.tpm.enable) [
11631163+ "-chardev socket,id=chrtpm,path=\"$NIX_SWTPM_DIR\"/socket"
11641164+ "-tpmdev emulator,id=tpm_dev_0,chardev=chrtpm"
11651165+ "-device ${cfg.tpm.deviceModel},tpmdev=tpm_dev_0"
11011166 ])
11021167 ];
11031168
+14-16
nixos/tests/firefox.nix
···11import ./make-test-python.nix ({ pkgs, firefoxPackage, ... }:
22-let firefoxPackage' = firefoxPackage.override (args: {
33- extraPrefsFiles = (args.extraPrefsFiles or []) ++ [
44- # make sure that autoplay is enabled by default for the audio test
55- (builtins.toString (builtins.toFile "autoplay-pref.js" ''defaultPref("media.autoplay.default",0);''))
66- ];
77- });
22+{
33+ name = firefoxPackage.pname;
8499-in
1010-{
1111- name = firefoxPackage'.unwrapped.pname;
125 meta = with pkgs.lib.maintainers; {
136 maintainers = [ eelco shlevy ];
147 };
···1710 { pkgs, ... }:
18111912 { imports = [ ./common/x11.nix ];
2020- environment.systemPackages = [
2121- firefoxPackage'
2222- pkgs.xdotool
2323- ];
1313+ environment.systemPackages = [ pkgs.xdotool ];
1414+1515+ programs.firefox = {
1616+ enable = true;
1717+ preferences."media.autoplay.default" = 0;
1818+ package = firefoxPackage;
1919+ };
24202521 # Create a virtual sound device, with mixing
2622 # and all, for recording audio.
···58545955 };
60566161- testScript = ''
5757+ testScript = let
5858+ exe = firefoxPackage.unwrapped.binaryName;
5959+ in ''
6260 from contextlib import contextmanager
63616462···97959896 with subtest("Wait until Firefox has finished loading the Valgrind docs page"):
9997 machine.execute(
100100- "xterm -e '${firefoxPackage'.unwrapped.binaryName} file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' >&2 &"
9898+ "xterm -e '${exe} file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' >&2 &"
10199 )
102100 machine.wait_for_window("Valgrind")
103101 machine.sleep(40)
···105103 with subtest("Check whether Firefox can play sound"):
106104 with record_audio(machine):
107105 machine.succeed(
108108- "${firefoxPackage'.unwrapped.binaryName} file://${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/phone-incoming-call.oga >&2 &"
106106+ "${exe} file://${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/phone-incoming-call.oga >&2 &"
109107 )
110108 wait_for_sound(machine)
111109 machine.copy_from_vm("/tmp/record.wav")
···202202 changelog = "https://github.com/openzfs/zfs/releases/tag/zfs-${version}";
203203 license = lib.licenses.cddl;
204204205205- # The case-block for TARGET_CPU has branches for only five CPU families,
205205+ # The case-block for TARGET_CPU has branches for only some CPU families,
206206 # which prevents ZFS from building on any other platform. Since the NixOS
207207 # `boot.zfs.enabled` property is `readOnly`, excluding platforms where ZFS
208208 # does not build is the only way to produce a NixOS installer on such
209209 # platforms.
210210- # https://github.com/openzfs/zfs/blob/6a6bd493988c75331deab06e5352a9bed035a87d/config/always-arch.m4#L16
210210+ # https://github.com/openzfs/zfs/blob/6723d1110f6daf93be93db74d5ea9f6b64c9bce5/config/always-arch.m4#L12
211211 platforms =
212212 with lib.systems.inspect.patterns;
213213- map (p: p // isLinux) [ isx86_32 isx86_64 isPower isAarch64 isSparc ];
213213+ map (p: p // isLinux) ([ isx86_32 isx86_64 isPower isAarch64 isSparc ] ++ isArmv7);
214214215215 maintainers = with lib.maintainers; [ jcumming jonringer globin raitobezarius ];
216216 mainProgram = "zfs";
···33, fetchFromGitHub
44, autoreconfHook
55, pkg-config
66+, gitUpdater
67}:
7889stdenv.mkDerivation rec {
99- version = "1.2.3";
1010+ version = "1.2.4";
1011 pname = "nqptp";
11121213 src = fetchFromGitHub {
1314 owner = "mikebrady";
1415 repo = pname;
1516 rev = "refs/tags/${version}";
1616- hash = "sha256-Ppsz3hDG6sEf6LJ2WdbTdJ8Gi53f0YmvaUU8TOfVMz4=";
1717+ hash = "sha256-roTNcr3v2kzE6vQ5plAVtlw1+2yJplltOYsGGibtoZo=";
1718 };
18192020+ patches = [
2121+ # this patch should be removed when > 1.2.4
2222+ ./remove-setcap.patch
2323+ ];
2424+1925 nativeBuildInputs = [ autoreconfHook pkg-config ];
20262121- meta = with lib; {
2727+ passthru.updateScript = gitUpdater {
2828+ ignoredVersions = ".*(-dev|d0)";
2929+ };
3030+3131+ meta = {
2232 homepage = "https://github.com/mikebrady/nqptp";
2333 description = "Daemon and companion application to Shairport Sync that monitors timing data from any PTP clocks";
2424- license = licenses.gpl2Only;
2525- maintainers = with maintainers; [ jordanisaacs ];
2626- platforms = platforms.linux ++ platforms.freebsd;
3434+ license = lib.licenses.gpl2Only;
3535+ maintainers = with lib.maintainers; [ jordanisaacs adamcstephens ];
3636+ platforms = lib.platforms.linux ++ lib.platforms.freebsd;
2737 };
2838}
+13
pkgs/tools/networking/nqptp/remove-setcap.patch
···11+diff --git a/Makefile.am b/Makefile.am
22+index 78f36d7..8dc4e4f 100644
33+--- a/Makefile.am
44++++ b/Makefile.am
55+@@ -19,8 +19,6 @@ endif
66+77+ install-exec-hook:
88+ if BUILD_FOR_LINUX
99+-# NQPTP runs as user/group nqptp/nqptp on Linux and uses setcap to access ports 319 and 320
1010+- setcap 'cap_net_bind_service=+ep' $(bindir)/nqptp
1111+ # no installer for System V
1212+ if INSTALL_SYSTEMD_STARTUP
1313+ getent group nqptp &>/dev/null || groupadd -r nqptp &>/dev/null