···48 '';
49 };
5051+ overrideStrategy = mkOption {
52+ default = "asDropinIfExists";
53+ type = types.enum [ "asDropinIfExists" "asDropin" ];
54+ description = lib.mdDoc ''
55+ Defines how unit configuration is provided for systemd:
56+57+ `asDropinIfExists` creates a unit file when no unit file is provided by the package
58+ otherwise a drop-in file name `overrides.conf`.
59+60+ `asDropin` creates a drop-in file named `overrides.conf`.
61+ Mainly needed to define instances for systemd template units (e.g. `systemd-nspawn@mycontainer.service`).
62+63+ See also systemd.unit(1).
64+ '';
65+ };
66+67 requiredBy = mkOption {
68 default = [];
69 type = types.listOf unitNameType;
+7-4
nixos/modules/services/networking/mosquitto.nix
···56 default = null;
57 description = mdDoc ''
58 Specifies the hashed password for the MQTT User.
59- To generate hashed password install `mosquitto`
60- package and use `mosquitto_passwd`.
0061 '';
62 };
63···68 description = mdDoc ''
69 Specifies the path to a file containing the
70 hashed password for the MQTT user.
71- To generate hashed password install `mosquitto`
72- package and use `mosquitto_passwd`.
073 '';
74 };
75
···56 default = null;
57 description = mdDoc ''
58 Specifies the hashed password for the MQTT User.
59+ To generate hashed password install the `mosquitto`
60+ package and use `mosquitto_passwd`, then extract
61+ the second field (after the `:`) from the generated
62+ file.
63 '';
64 };
65···70 description = mdDoc ''
71 Specifies the path to a file containing the
72 hashed password for the MQTT user.
73+ To generate hashed password install the `mosquitto`
74+ package and use `mosquitto_passwd`, then remove the
75+ `username:` prefix from the generated file.
76 '';
77 };
78
···4445 # not needed, but we want to test the nspawn file generation
46 systemd.nspawn.${containerName} = { };
0000000047 };
4849 testScript = ''
···94 # Test machinectl stop
95 machine.succeed("machinectl stop ${containerName}");
96 machine.wait_until_succeeds("test $(systemctl is-active systemd-nspawn@${containerName}) = inactive");
0009798 # Show to to delete the container
99 machine.succeed("chattr -i ${containerRoot}/var/empty");
···4445 # not needed, but we want to test the nspawn file generation
46 systemd.nspawn.${containerName} = { };
47+48+ systemd.services."systemd-nspawn@${containerName}" = {
49+ serviceConfig.Environment = [
50+ # Disable tmpfs for /tmp
51+ "SYSTEMD_NSPAWN_TMPFS_TMP=0"
52+ ];
53+ overrideStrategy = "asDropin";
54+ };
55 };
5657 testScript = ''
···102 # Test machinectl stop
103 machine.succeed("machinectl stop ${containerName}");
104 machine.wait_until_succeeds("test $(systemctl is-active systemd-nspawn@${containerName}) = inactive");
105+106+ # Test tmpfs for /tmp
107+ machine.fail("mountpoint /tmp");
108109 # Show to to delete the container
110 machine.succeed("chattr -i ${containerRoot}/var/empty");
···33 }: let
34 pythonPackages = let
35 ensurePythonModules = items: let
00036 providesSetupHook = lib.attrByPath [ "provides" "setupHook"] false;
37- notValid = value: (lib.isDerivation value) && !((pythonPackages.hasPythonModule value) || (providesSetupHook value));
38- func = name: value: if !(notValid value) then value else throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.";
39 in lib.mapAttrs func items;
40 in ensurePythonModules (callPackage
41 # Function that when called
···33 }: let
34 pythonPackages = let
35 ensurePythonModules = items: let
36+ exceptions = [
37+ stdenv
38+ ];
39 providesSetupHook = lib.attrByPath [ "provides" "setupHook"] false;
40+ valid = value: !((lib.isDerivation value) && !((pythonPackages.hasPythonModule value) || (providesSetupHook value))) || (lib.elem value exceptions);
41+ func = name: value: if (valid value) then value else throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.";
42 in lib.mapAttrs func items;
43 in ensurePythonModules (callPackage
44 # Function that when called