···272272 </listitem>
273273 </varlistentry>
274274275275+ <varlistentry>
276276+ <term><methodname>systemctl</methodname></term>
277277+ <listitem>
278278+ <para>Runs <literal>systemctl</literal> commands with optional support for
279279+ <literal>systemctl --user</literal></para>
280280+ <para>
281281+ <programlisting>
282282+ $machine->systemctl("list-jobs --no-pager"); // runs `systemctl list-jobs --no-pager`
283283+ $machine->systemctl("list-jobs --no-pager", "any-user"); // spawns a shell for `any-user` and runs `systemctl --user list-jobs --no-pager`
284284+ </programlisting>
285285+ </para>
286286+ </listitem>
287287+ </varlistentry>
288288+275289</variablelist>
276290291291+</para>
292292+293293+<para>
294294+ To test user units declared by <literal>systemd.user.services</literal> the optional <literal>$user</literal>
295295+ argument can be used:
296296+297297+ <programlisting>
298298+ $machine->start;
299299+ $machine->waitForX;
300300+ $machine->waitForUnit("xautolock.service", "x-session-user");
301301+ </programlisting>
302302+303303+ This applies to <literal>systemctl</literal>, <literal>getUnitInfo</literal>,
304304+ <literal>waitForUnit</literal>, <literal>startJob</literal>
305305+ and <literal>stopJob</literal>.
277306</para>
278307279308</section>
+17-3
nixos/doc/manual/installation/installing-usb.xml
···1111<command>dd if=<replaceable>path-to-image</replaceable>
1212of=<replaceable>/dev/sdb</replaceable></command>. Be careful about specifying the
1313correct drive; you can use the <command>lsblk</command> command to get a list of
1414-block devices. If you're on macOS you can run <command>diskutil list</command>
1515-to see the list of devices; the device you'll use for the USB must be ejected
1616-before writing the image.</para>
1414+block devices.</para>
17151616+<para>On macOS:
1717+<programlisting>
1818+$ diskutil list
1919+[..]
2020+/dev/diskN (external, physical):
2121+ #: TYPE NAME SIZE IDENTIFIER
2222+[..]
2323+$ diskutil unmountDisk diskN
2424+Unmount of all volumes on diskN was successful
2525+$ sudo dd bs=1m if=nix.iso of=/dev/rdiskN
2626+</programlisting>
2727+Using the 'raw' <command>rdiskN</command> device instead of <command>diskN</command>
2828+completes in minutes instead of hours. After <command>dd</command> completes, a GUI
2929+dialog "The disk you inserted was not readable by this computer" will pop up, which
3030+can be ignored.</para>
3131+1832<para>The <command>dd</command> utility will write the image verbatim to the drive,
1933making it the recommended option for both UEFI and non-UEFI installations. For
2034non-UEFI installations, you can alternatively use
+7
nixos/doc/manual/release-notes/rl-1803.xml
···234234 to your <literal>configuration.nix</literal>.
235235 </para>
236236 </listitem>
237237+ <listitem>
238238+ <para>
239239+ The NixOS test driver supports user services declared by <literal>systemd.user.services</literal>.
240240+ The methods <literal>waitForUnit</literal>, <literal>getUnitInfo</literal>, <literal>startJob</literal>
241241+ and <literal>stopJob</literal> provide an optional <literal>$user</literal> argument for that purpose.
242242+ </para>
243243+ </listitem>
237244</itemizedlist>
238245239246</section>
···11+{ config, lib, pkgs, ... }:
22+33+with lib;
44+55+let
66+77+ defaultUserGroup = "usbmux";
88+ apple = "05ac";
99+1010+ cfg = config.services.usbmuxd;
1111+1212+in
1313+1414+{
1515+ options.services.usbmuxd = {
1616+ enable = mkOption {
1717+ type = types.bool;
1818+ default = false;
1919+ description = ''
2020+ Enable the usbmuxd ("USB multiplexing daemon") service. This daemon is
2121+ in charge of multiplexing connections over USB to an iOS device. This is
2222+ needed for transferring data from and to iOS devices (see ifuse). Also
2323+ this may enable plug-n-play tethering for iPhones.
2424+ '';
2525+ };
2626+2727+ user = mkOption {
2828+ type = types.str;
2929+ default = defaultUserGroup;
3030+ description = ''
3131+ The user usbmuxd should use to run after startup.
3232+ '';
3333+ };
3434+3535+ group = mkOption {
3636+ type = types.str;
3737+ default = defaultUserGroup;
3838+ description = ''
3939+ The group usbmuxd should use to run after startup.
4040+ '';
4141+ };
4242+ };
4343+4444+ config = mkIf cfg.enable {
4545+4646+ users.extraUsers = optional (cfg.user == defaultUserGroup) {
4747+ name = cfg.user;
4848+ description = "usbmuxd user";
4949+ group = cfg.group;
5050+ };
5151+5252+ users.extraGroups = optional (cfg.group == defaultUserGroup) {
5353+ name = cfg.group;
5454+ };
5555+5656+ # Give usbmuxd permission for Apple devices
5757+ services.udev.extraRules = ''
5858+ SUBSYSTEM=="usb", ATTR{idVendor}=="${apple}", GROUP="${cfg.group}"
5959+ '';
6060+6161+ systemd.services.usbmuxd = {
6262+ description = "usbmuxd";
6363+ wantedBy = [ "multi-user.target" ];
6464+ unitConfig.Documentation = "man:usbmuxd(8)";
6565+ serviceConfig = {
6666+ # Trigger the udev rule manually. This doesn't require replugging the
6767+ # device when first enabling the option to get it to work
6868+ ExecStartPre = "${pkgs.libudev}/bin/udevadm trigger -s usb -a idVendor=${apple}";
6969+ ExecStart = "${pkgs.usbmuxd}/bin/usbmuxd -U ${cfg.user} -f";
7070+ };
7171+ };
7272+7373+ };
7474+}
···197197 "mmc_block"
198198199199 # Support USB keyboards, in case the boot fails and we only have
200200- # a USB keyboard.
200200+ # a USB keyboard, or for LUKS passphrase prompt.
201201 "uhci_hcd"
202202 "ehci_hcd"
203203 "ehci_pci"
···206206 "xhci_hcd"
207207 "xhci_pci"
208208 "usbhid"
209209- "hid_generic" "hid_lenovo" "hid_apple" "hid_roccat"
209209+ "hid_generic" "hid_lenovo" "hid_apple" "hid_roccat" "hid_logitech_hidpp"
210210211211 # Misc. keyboard stuff.
212212 "pcips2" "atkbd" "i8042"
···2233stdenv.mkDerivation rec {
44 name = "abcMIDI-${version}";
55- version = "2017.12.20";
55+ version = "2018.01.02";
6677 # You can find new releases on http://ifdo.ca/~seymour/runabc/top.html
88 src = fetchzip {
99 url = "http://ifdo.ca/~seymour/runabc/${name}.zip";
1010- sha256 = "0lkbwrh701djbyqmybvx860p8csy25i6p3p7hr0cpndpa496nm07";
1010+ sha256 = "0s8wm637dgzgpgdxba3a6fh06i0c4iwvv9cdghh8msnx428k68iw";
1111 };
12121313 # There is also a file called "makefile" which seems to be preferred by the standard build phase