···126126 </listitem>
127127 <listitem>
128128 <para>
129129+ <link xlink:href="https://github.com/mozilla-services/syncstorage-rs">syncstorage-rs</link>,
130130+ a self-hostable sync server for Firefox. Available as
131131+ <link xlink:href="options.html#opt-services.firefox-syncserver.enable">services.firefox-syncserver</link>.
132132+ </para>
133133+ </listitem>
134134+ <listitem>
135135+ <para>
129136 <link xlink:href="https://dragonflydb.io/">dragonflydb</link>,
130137 a modern replacement for Redis and Memcached. Available as
131138 <link linkend="opt-services.dragonflydb.enable">services.dragonflydb</link>.
+1
nixos/doc/manual/release-notes/rl-2211.section.md
···5555## New Services {#sec-release-22.11-new-services}
56565757- [appvm](https://github.com/jollheef/appvm), Nix based app VMs. Available as [virtualisation.appvm](options.html#opt-virtualisation.appvm.enable).
5858+- [syncstorage-rs](https://github.com/mozilla-services/syncstorage-rs), a self-hostable sync server for Firefox. Available as [services.firefox-syncserver](options.html#opt-services.firefox-syncserver.enable).
58595960- [dragonflydb](https://dragonflydb.io/), a modern replacement for Redis and Memcached. Available as [services.dragonflydb](#opt-services.dragonflydb.enable).
6061
···11+# Firefox Sync server {#module-services-firefox-syncserver}
22+33+A storage server for Firefox Sync that you can easily host yourself.
44+55+## Quickstart {#module-services-firefox-syncserver-quickstart}
66+77+The absolute minimal configuration for the sync server looks like this:
88+99+```nix
1010+services.mysql.package = pkgs.mariadb;
1111+1212+services.firefox-syncserver = {
1313+ enable = true;
1414+ secrets = builtins.toFile "sync-secrets" ''
1515+ SYNC_MASTER_SECRET=this-secret-is-actually-leaked-to-/nix/store
1616+ '';
1717+ singleNode = {
1818+ enable = true;
1919+ hostname = "localhost";
2020+ url = "http://localhost:5000";
2121+ };
2222+};
2323+```
2424+2525+This will start a sync server that is only accessible locally. Once the services is
2626+running you can navigate to `about:config` in your Firefox profile and set
2727+`identity.sync.tokenserver.uri` to `http://localhost:5000/1.0/sync/1.5`. Your browser
2828+will now use your local sync server for data storage.
2929+3030+::: {.warning}
3131+This configuration should never be used in production. It is not encrypted and
3232+stores its secrets in a world-readable location.
3333+:::
3434+3535+## More detailed setup {#module-services-firefox-syncserver-configuration}
3636+3737+The `firefox-syncserver` service provides a number of options to make setting up
3838+small deployment easier. These are grouped under the `singleNode` element of the
3939+option tree and allow simple configuration of the most important parameters.
4040+4141+Single node setup is split into two kinds of options: those that affect the sync
4242+server itself, and those that affect its surroundings. Options that affect the
4343+sync server are `capacity`, which configures how many accounts may be active on
4444+this instance, and `url`, which holds the URL under which the sync server can be
4545+accessed. The `url` can be configured automatically when using nginx.
4646+4747+Options that affect the surroundings of the sync server are `enableNginx`,
4848+`enableTLS` and `hostnam`. If `enableNginx` is set the sync server module will
4949+automatically add an nginx virtual host to the system using `hostname` as the
5050+domain and set `url` accordingly. If `enableTLS` is set the module will also
5151+enable ACME certificates on the new virtual host and force all connections to
5252+be made via TLS.
5353+5454+For actual deployment it is also recommended to store the `secrets` file in a
5555+secure location.
···11+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="module-services-firefox-syncserver">
22+ <title>Firefox Sync server</title>
33+ <para>
44+ A storage server for Firefox Sync that you can easily host yourself.
55+ </para>
66+ <section xml:id="module-services-firefox-syncserver-quickstart">
77+ <title>Quickstart</title>
88+ <para>
99+ The absolute minimal configuration for the sync server looks like
1010+ this:
1111+ </para>
1212+ <programlisting language="nix">
1313+services.mysql.package = pkgs.mariadb;
1414+1515+services.firefox-syncserver = {
1616+ enable = true;
1717+ secrets = builtins.toFile "sync-secrets" ''
1818+ SYNC_MASTER_SECRET=this-secret-is-actually-leaked-to-/nix/store
1919+ '';
2020+ singleNode = {
2121+ enable = true;
2222+ hostname = "localhost";
2323+ url = "http://localhost:5000";
2424+ };
2525+};
2626+</programlisting>
2727+ <para>
2828+ This will start a sync server that is only accessible locally.
2929+ Once the services is running you can navigate to
3030+ <literal>about:config</literal> in your Firefox profile and set
3131+ <literal>identity.sync.tokenserver.uri</literal> to
3232+ <literal>http://localhost:5000/1.0/sync/1.5</literal>. Your
3333+ browser will now use your local sync server for data storage.
3434+ </para>
3535+ <warning>
3636+ <para>
3737+ This configuration should never be used in production. It is not
3838+ encrypted and stores its secrets in a world-readable location.
3939+ </para>
4040+ </warning>
4141+ </section>
4242+ <section xml:id="module-services-firefox-syncserver-configuration">
4343+ <title>More detailed setup</title>
4444+ <para>
4545+ The <literal>firefox-syncserver</literal> service provides a
4646+ number of options to make setting up small deployment easier.
4747+ These are grouped under the <literal>singleNode</literal> element
4848+ of the option tree and allow simple configuration of the most
4949+ important parameters.
5050+ </para>
5151+ <para>
5252+ Single node setup is split into two kinds of options: those that
5353+ affect the sync server itself, and those that affect its
5454+ surroundings. Options that affect the sync server are
5555+ <literal>capacity</literal>, which configures how many accounts
5656+ may be active on this instance, and <literal>url</literal>, which
5757+ holds the URL under which the sync server can be accessed. The
5858+ <literal>url</literal> can be configured automatically when using
5959+ nginx.
6060+ </para>
6161+ <para>
6262+ Options that affect the surroundings of the sync server are
6363+ <literal>enableNginx</literal>, <literal>enableTLS</literal> and
6464+ <literal>hostnam</literal>. If <literal>enableNginx</literal> is
6565+ set the sync server module will automatically add an nginx virtual
6666+ host to the system using <literal>hostname</literal> as the domain
6767+ and set <literal>url</literal> accordingly. If
6868+ <literal>enableTLS</literal> is set the module will also enable
6969+ ACME certificates on the new virtual host and force all
7070+ connections to be made via TLS.
7171+ </para>
7272+ <para>
7373+ For actual deployment it is also recommended to store the
7474+ <literal>secrets</literal> file in a secure location.
7575+ </para>
7676+ </section>
7777+</chapter>
···11-export HARECACHE="$NIX_BUILD_TOP/.harecache"
22-31addHarepath () {
42 for haredir in third-party stdlib; do
53 if [[ -d "$1/src/hare/$haredir" ]]; then
···11+{ lib, stdenv, fetchFromGitHub, AppKit, Cocoa }:
22+33+let
44+ pname = "pngpaste";
55+ version = "0.2.3";
66+in stdenv.mkDerivation {
77+ inherit pname version;
88+ src = fetchFromGitHub {
99+ owner = "jcsalterego";
1010+ repo = pname;
1111+ rev = version;
1212+ sha256 = "uvajxSelk1Wfd5is5kmT2fzDShlufBgC0PDCeabEOSE=";
1313+ };
1414+1515+ buildInputs = [ AppKit Cocoa ];
1616+1717+ installPhase = ''
1818+ mkdir -p $out/bin
1919+ cp pngpaste $out/bin
2020+ '';
2121+2222+ meta = with lib; {
2323+ description = "Paste image files from clipboard to file on MacOS";
2424+ longDescription = ''
2525+ Paste PNG into files on MacOS, much like pbpaste does for text.
2626+ Supported input formats are PNG, PDF, GIF, TIF, JPEG.
2727+ Supported output formats are PNG, GIF, JPEG, TIFF. Output
2828+ formats are determined by the provided filename extension,
2929+ falling back to PNG.
3030+ '';
3131+ homepage = "https://github.com/jcsalterego/pngpaste";
3232+ changelog = "https://github.com/jcsalterego/pngpaste/raw/${version}/CHANGELOG.md";
3333+ platforms = platforms.darwin;
3434+ license = licenses.bsd2;
3535+ maintainers = with maintainers; [ samw ];
3636+ };
3737+}
+6-12
pkgs/os-specific/solo5/default.nix
···22, pkg-config, qemu, syslinux, util-linux }:
3344let
55- version = "0.6.9";
55+ version = "0.7.3";
66 # list of all theoretically available targets
77 targets = [
88 "genode"
···21212222 src = fetchurl {
2323 url = "https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz";
2424- sha256 = "03lvk9mab3yxrmi73wrvvhykqcydjrsda0wj6aasnjm5lx9jycpr";
2424+ sha256 = "sha256-8LftT22XzmmWxgYez+BAHDX4HOyl5DrwrpuO2+bqqcY=";
2525 };
26262727+ patches = [ ./test_sleep.patch ];
2828+2729 hardeningEnable = [ "pie" ];
28302931 configurePhase = ''
3032 runHook preConfigure
3131- sh configure.sh
3333+ sh configure.sh --prefix=/
3234 runHook postConfigure
3335 '';
3436···3840 runHook preInstall
3941 export DESTDIR=$out
4042 export PREFIX=$out
4141- make install-tools
4242-4343- # get CONFIG_* vars from Makeconf which also parse in sh
4444- grep '^CONFIG_' Makeconf > nix_tmp_targetconf
4545- source nix_tmp_targetconf
4646- # install opam / pkg-config files for all enabled targets
4747- ${lib.concatMapStrings (bind: ''
4848- [ -n "$CONFIG_${lib.toUpper bind}" ] && make install-opam-${bind}
4949- '') targets}
4343+ make install
50445145 substituteInPlace $out/bin/solo5-virtio-mkimage \
5246 --replace "/usr/lib/syslinux" "${syslinux}/share/syslinux" \
+22
pkgs/os-specific/solo5/test_sleep.patch
···11+diff --git a/tests/test_time/test_time.c b/tests/test_time/test_time.c
22+index 931500b..cde64ad 100644
33+--- a/tests/test_time/test_time.c
44++++ b/tests/test_time/test_time.c
55+@@ -110,7 +110,8 @@ int solo5_app_main(const struct solo5_start_info *si __attribute__((unused)))
66+ /*
77+ * Verify that we did not sleep less than requested (see above).
88+ */
99+- if (delta < NSEC_PER_SEC) {
1010++ const solo5_time_t slack = 100000000ULL;
1111++ if (delta < NSEC_PER_SEC - slack) {
1212+ printf("[%d] ERROR: slept too little (expected at least %llu ns)\n",
1313+ iters, (unsigned long long)NSEC_PER_SEC);
1414+ failed = true;
1515+@@ -120,7 +121,6 @@ int solo5_app_main(const struct solo5_start_info *si __attribute__((unused)))
1616+ * Verify that we did not sleep more than requested, within reason
1717+ * (scheduling delays, general inaccuracy of the current timing code).
1818+ */
1919+- const solo5_time_t slack = 100000000ULL;
2020+ if (delta > (NSEC_PER_SEC + slack)) {
2121+ printf("[%d] ERROR: slept too much (expected at most %llu ns)\n",
2222+ iters, (unsigned long long)slack);