···146 "/etc/os-release".source = initrdRelease;
147 "/etc/initrd-release".source = initrdRelease;
148 };
000000000149 };
150151 # uses version info nixpkgs, which requires a full nixpkgs path
···146 "/etc/os-release".source = initrdRelease;
147 "/etc/initrd-release".source = initrdRelease;
148 };
149+150+ # We have to use `warnings` because when warning in the default of the option
151+ # the warning would also be shown when building the manual since the manual
152+ # has to evaluate the default.
153+ #
154+ # TODO Remove this and drop the default of the option so people are forced to set it.
155+ # Doing this also means fixing the comment in nixos/modules/testing/test-instrumentation.nix
156+ warnings = lib.optional (options.system.stateVersion.highestPrio == (lib.mkOptionDefault { }).priority)
157+ "system.stateVersion is not set, defaulting to ${config.system.stateVersion}. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.";
158 };
159160 # uses version info nixpkgs, which requires a full nixpkgs path
+1
nixos/modules/services/matrix/matrix-synapse.nix
···296 default = if lib.versionAtLeast config.system.stateVersion "22.05"
297 then "${cfg.dataDir}/media_store"
298 else "${cfg.dataDir}/media";
0299 description = ''
300 Directory where uploaded images and attachments are stored.
301 '';
···296 default = if lib.versionAtLeast config.system.stateVersion "22.05"
297 then "${cfg.dataDir}/media_store"
298 else "${cfg.dataDir}/media";
299+ defaultText = "${cfg.dataDir}/media_store for when system.stateVersion is at least 22.05, ${cfg.dataDir}/media when lower than 22.05";
300 description = ''
301 Directory where uploaded images and attachments are stored.
302 '';
···129 # Make sure we use the Guest Agent from the QEMU package for testing
130 # to reduce the closure size required for the tests.
131 services.qemuGuest.package = pkgs.qemu_test.ga;
000132 };
133134}
···129 # Make sure we use the Guest Agent from the QEMU package for testing
130 # to reduce the closure size required for the tests.
131 services.qemuGuest.package = pkgs.qemu_test.ga;
132+133+ # Squelch warning about unset system.stateVersion
134+ system.stateVersion = lib.mkDefault lib.trivial.release;
135 };
136137}
+18-2
nixos/tests/pleroma.nix
···32 # system one. Overriding this pretty bad default behaviour.
33 export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
3435- echo "jamy-password" | toot login_cli -i "pleroma.nixos.test" -e "jamy@nixos.test"
036 echo "Login OK"
3738 # Send a toot then verify it's part of the public timeline
···167 cp key.pem cert.pem $out
168 '';
169000000000000000170 hosts = nodes: ''
171 ${nodes.pleroma.config.networking.primaryIPAddress} pleroma.nixos.test
172 ${nodes.client.config.networking.primaryIPAddress} client.nixos.test
···178 security.pki.certificateFiles = [ "${tls-cert}/cert.pem" ];
179 networking.extraHosts = hosts nodes;
180 environment.systemPackages = with pkgs; [
181- toot
182 send-toot
183 ];
184 };
···32 # system one. Overriding this pretty bad default behaviour.
33 export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
3435+ export TOOT_LOGIN_CLI_PASSWORD="jamy-password"
36+ toot login_cli -i "pleroma.nixos.test" -e "jamy@nixos.test"
37 echo "Login OK"
3839 # Send a toot then verify it's part of the public timeline
···168 cp key.pem cert.pem $out
169 '';
170171+ /* Toot is preventing users from feeding login_cli a password non
172+ interactively. While it makes sense most of the times, it's
173+ preventing us to login in this non-interactive test. This patch
174+ introduce a TOOT_LOGIN_CLI_PASSWORD env variable allowing us to
175+ provide a password to toot login_cli
176+177+ If https://github.com/ihabunek/toot/pull/180 gets merged at some
178+ point, feel free to remove this patch. */
179+ custom-toot = pkgs.toot.overrideAttrs(old:{
180+ patches = [ (pkgs.fetchpatch {
181+ url = "https://github.com/NinjaTrappeur/toot/commit/b4a4c30f41c0cb7e336714c2c4af9bc9bfa0c9f2.patch";
182+ sha256 = "sha256-0xxNwjR/fStLjjUUhwzCCfrghRVts+fc+fvVJqVcaFg=";
183+ }) ];
184+ });
185+186 hosts = nodes: ''
187 ${nodes.pleroma.config.networking.primaryIPAddress} pleroma.nixos.test
188 ${nodes.client.config.networking.primaryIPAddress} client.nixos.test
···194 security.pki.certificateFiles = [ "${tls-cert}/cert.pem" ];
195 networking.extraHosts = hosts nodes;
196 environment.systemPackages = with pkgs; [
197+ custom-toot
198 send-toot
199 ];
200 };