···189189 # manually paste it in place. Just symlink.
190190 # otherwise, create the target file, ready for users to insert the token
191191192192- mkdir -p $(dirname ${certmgrAPITokenPath})
192192+ mkdir -p "$(dirname "${certmgrAPITokenPath}")"
193193 if [ -f "${cfsslAPITokenPath}" ]; then
194194 ln -fs "${cfsslAPITokenPath}" "${certmgrAPITokenPath}"
195195 else
+53-39
nixos/modules/services/networking/syncthing.nix
···2525 folder.enable
2626 ) cfg.declarative.folders);
27272828- # get the api key by parsing the config.xml
2929- getApiKey = pkgs.writers.writeDash "getAPIKey" ''
3030- ${pkgs.libxml2}/bin/xmllint \
3131- --xpath 'string(configuration/gui/apikey)'\
3232- ${cfg.configDir}/config.xml
3333- '';
3434-3528 updateConfig = pkgs.writers.writeDash "merge-syncthing-config" ''
3629 set -efu
3737- # wait for syncthing port to open
3838- until ${pkgs.curl}/bin/curl -Ss ${cfg.guiAddress} -o /dev/null; do
3939- sleep 1
4040- done
41304242- API_KEY=$(${getApiKey})
4343- OLD_CFG=$(${pkgs.curl}/bin/curl -Ss \
4444- -H "X-API-Key: $API_KEY" \
4545- ${cfg.guiAddress}/rest/system/config)
3131+ # get the api key by parsing the config.xml
3232+ while
3333+ ! api_key=$(${pkgs.libxml2}/bin/xmllint \
3434+ --xpath 'string(configuration/gui/apikey)' \
3535+ ${cfg.configDir}/config.xml)
3636+ do sleep 1; done
46374747- # generate the new config by merging with the nixos config options
4848- NEW_CFG=$(echo "$OLD_CFG" | ${pkgs.jq}/bin/jq -s '.[] as $in | $in * {
4949- "devices": (${builtins.toJSON devices}${optionalString (! cfg.declarative.overrideDevices) " + $in.devices"}),
5050- "folders": (${builtins.toJSON folders}${optionalString (! cfg.declarative.overrideFolders) " + $in.folders"})
5151- }')
3838+ curl() {
3939+ while
4040+ ${pkgs.curl}/bin/curl -Ss -H "X-API-Key: $api_key" \
4141+ --retry 100 --retry-delay 1 --retry-connrefused "$@"
4242+ status=$?
4343+ [ "$status" -eq 52 ] # retry on empty reply from server
4444+ do sleep 1; done
4545+ return "$status"
4646+ }
52475353- # POST the new config to syncthing
5454- echo "$NEW_CFG" | ${pkgs.curl}/bin/curl -Ss \
5555- -H "X-API-Key: $API_KEY" \
5656- ${cfg.guiAddress}/rest/system/config -d @-
4848+ # query the old config
4949+ old_cfg=$(curl ${cfg.guiAddress}/rest/config)
57505858- # restart syncthing after sending the new config
5959- ${pkgs.curl}/bin/curl -Ss \
6060- -H "X-API-Key: $API_KEY" \
6161- -X POST \
6262- ${cfg.guiAddress}/rest/system/restart
5151+ # generate the new config by merging with the NixOS config options
5252+ new_cfg=$(echo "$old_cfg" | ${pkgs.jq}/bin/jq -c '. * {
5353+ "devices": (${builtins.toJSON devices}${optionalString (! cfg.declarative.overrideDevices) " + .devices"}),
5454+ "folders": (${builtins.toJSON folders}${optionalString (! cfg.declarative.overrideFolders) " + .folders"})
5555+ } * ${builtins.toJSON cfg.declarative.extraOptions}')
5656+5757+ # send the new config
5858+ curl -X PUT -d "$new_cfg" ${cfg.guiAddress}/rest/config
5959+6060+ # restart Syncthing if required
6161+ if curl ${cfg.guiAddress}/rest/config/restart-required |
6262+ ${pkgs.jq}/bin/jq -e .requiresRestart > /dev/null; then
6363+ curl -X POST ${cfg.guiAddress}/rest/system/restart
6464+ fi
6365 '';
6466in {
6567 ###### interface
···7779 type = types.nullOr types.str;
7880 default = null;
7981 description = ''
8080- Path to users cert.pem file, will be copied into the syncthing's
8282+ Path to users cert.pem file, will be copied into Syncthing's
8183 <literal>configDir</literal>
8284 '';
8385 };
···8688 type = types.nullOr types.str;
8789 default = null;
8890 description = ''
8989- Path to users key.pem file, will be copied into the syncthing's
9191+ Path to users key.pem file, will be copied into Syncthing's
9092 <literal>configDir</literal>
9193 '';
9294 };
···105107 devices = mkOption {
106108 default = {};
107109 description = ''
108108- Peers/devices which syncthing should communicate with.
110110+ Peers/devices which Syncthing should communicate with.
109111 '';
110112 example = {
111113 bigbox = {
···168170 folders = mkOption {
169171 default = {};
170172 description = ''
171171- folders which should be shared by syncthing.
173173+ Folders which should be shared by Syncthing.
172174 '';
173175 example = literalExample ''
174176 {
···227229 versioning = mkOption {
228230 default = null;
229231 description = ''
230230- How to keep changed/deleted files with syncthing.
232232+ How to keep changed/deleted files with Syncthing.
231233 There are 4 different types of versioning with different parameters.
232234 See https://docs.syncthing.net/users/versioning.html
233235 '';
···335337 upstream's docs</link>.
336338 '';
337339 };
338338-339340 };
340341 }));
341342 };
343343+344344+ extraOptions = mkOption {
345345+ type = types.addCheck (pkgs.formats.json {}).type isAttrs;
346346+ default = {};
347347+ description = ''
348348+ Extra configuration options for Syncthing.
349349+ '';
350350+ example = {
351351+ options.localAnnounceEnabled = false;
352352+ gui.theme = "black";
353353+ };
354354+ };
342355 };
343356344357 guiAddress = mkOption {
···378391 default = null;
379392 example = "socks5://address.com:1234";
380393 description = ''
381381- Overwrites all_proxy environment variable for the syncthing process to
394394+ Overwrites all_proxy environment variable for the Syncthing process to
382395 the given value. This is normaly used to let relay client connect
383396 through SOCKS5 proxy server.
384397 '';
···412425 Open the default ports in the firewall:
413426 - TCP 22000 for transfers
414427 - UDP 21027 for discovery
415415- If multiple users are running syncthing on this machine, you will need to manually open a set of ports for each instance and leave this disabled.
428428+ If multiple users are running Syncthing on this machine, you will need to manually open a set of ports for each instance and leave this disabled.
416429 Alternatively, if are running only a single instance on this machine using the default ports, enable this.
417430 '';
418431 };
···431444432445 imports = [
433446 (mkRemovedOptionModule ["services" "syncthing" "useInotify"] ''
434434- This option was removed because syncthing now has the inotify functionality included under the name "fswatcher".
447447+ This option was removed because Syncthing now has the inotify functionality included under the name "fswatcher".
435448 It can be enabled on a per-folder basis through the webinterface.
436449 '')
437450 ];
···516529 };
517530 };
518531 syncthing-init = mkIf (
519519- cfg.declarative.devices != {} || cfg.declarative.folders != {}
532532+ cfg.declarative.devices != {} || cfg.declarative.folders != {} || cfg.declarative.extraOptions != {}
520533 ) {
534534+ description = "Syncthing configuration updater";
521535 after = [ "syncthing.service" ];
522536 wantedBy = [ "multi-user.target" ];
523537
···77, makeWrapper
88, rsync
99, installShellFiles
1010+, nixosTests
10111112, components ? [
1213 "cmd/kubelet"
···6667 install -D build/pause/linux/pause -t $pause/bin
6768 installManPage docs/man/man1/*.[1-9]
68696969- # Unfortunately, kube-addons-main.sh only looks for the lib file in either the current working dir
7070- # or in /opt. We have to patch this for now.
7070+ # Unfortunately, kube-addons-main.sh only looks for the lib file in either the
7171+ # current working dir or in /opt. We have to patch this for now.
7172 substitute cluster/addons/addon-manager/kube-addons-main.sh $out/bin/kube-addons \
7273 --subst-var out
7374···9495 homepage = "https://kubernetes.io";
9596 maintainers = with maintainers; [ johanot offline saschagrunert ];
9697 platforms = platforms.unix;
9898+ };
9999+100100+ passthru.tests = with nixosTests.kubernetes; {
101101+ dns-single-node = dns.singlenode;
102102+ dns-multi-node = dns.multinode;
103103+ rbac-single-node = rbac.singlenode;
104104+ rbac-multi-node = rbac.multinode;
97105 };
98106}
···33, gtkmm3, libpeas, gsettings-desktop-schemas, gobject-introspection, python3
4455# vim to be used, should support the GUI mode.
66-, vim ? vim_configurable.override { features = "normal"; gui = "auto"; }
66+, vim
7788# additional python3 packages to be available within plugins
99, extraPythonPackages ? []
···33333434 preConfigure = ''
3535 sed -i -e "s|ecwolf.pk3|$out/share/ecwolf/ecwolf.pk3|" src/version.h
3636+ ''
3737+ # Disable app bundle creation on Darwin. It fails, and it is not needed to run it from the Nix store
3838+ + lib.optionalString (stdenv.isDarwin) ''
3939+ sed -i -e "s|include(\''${CMAKE_CURRENT_SOURCE_DIR}/macosx/install.txt)||" src/CMakeLists.txt
3640 '';
37413842 # Install the required PK3 file in the required data directory
···4650 homepage = "https://maniacsvault.net/ecwolf/";
4751 license = licenses.gpl2Plus;
4852 maintainers = with maintainers; [ sander ];
4949- # Darwin is untested (supported by upstream)
5053 platforms = platforms.all;
5154 };
5255}
···3914391439153915 corehunt = libsForQt5.callPackage ../applications/misc/corehunt { };
3916391639173917+ coretoppings = libsForQt5.callPackage ../applications/misc/coretoppings { };
39183918+39173919 certstrap = callPackage ../tools/security/certstrap { };
3918392039193921 cfssl = callPackage ../tools/security/cfssl { };
···1121211214 langCC = false;
1121311215 langAda = true;
1121411216 profiledCompiler = false;
1121511215- inherit gnatboot;
1121711217+ # As per upstream instructions building a cross compiler
1121811218+ # should be done with a (native) compiler of the same version.
1121911219+ # If we are cross-compiling GNAT, we may as well go the same
1122011220+ # route (especially as gnatboot can't cross-compile).
1122111221+ gnatboot =
1122211222+ if stdenv.hostPlatform == stdenv.targetPlatform
1122311223+ && stdenv.buildPlatform == stdenv.hostPlatform
1122411224+ then buildPackages.gnatboot
1122511225+ else buildPackages.gnat6;
1121611226 });
11217112271121811228 gnat9 = wrapCC (gcc9.cc.override {
···1122111231 langCC = false;
1122211232 langAda = true;
1122311233 profiledCompiler = false;
1122411224- gnatboot = gnat6;
1123411234+ # As per upstream instructions building a cross compiler
1123511235+ # should be done with a (native) compiler of the same version.
1123611236+ # If we are cross-compiling GNAT, we may as well do the same.
1123711237+ gnatboot =
1123811238+ if stdenv.hostPlatform == stdenv.targetPlatform
1123911239+ && stdenv.buildPlatform == stdenv.hostPlatform
1124011240+ then buildPackages.gnat6
1124111241+ else buildPackages.gnat9;
1122511242 });
11226112431122711244 gnat10 = wrapCC (gcc10.cc.override {
···1123011247 langCC = false;
1123111248 langAda = true;
1123211249 profiledCompiler = false;
1123311233- gnatboot = gnat6;
1125011250+ # As per upstream instructions building a cross compiler
1125111251+ # should be done with a (native) compiler of the same version.
1125211252+ # If we are cross-compiling GNAT, we may as well do the same.
1125311253+ gnatboot =
1125411254+ if stdenv.hostPlatform == stdenv.targetPlatform
1125511255+ && stdenv.buildPlatform == stdenv.hostPlatform
1125611256+ then buildPackages.gnat6
1125711257+ else buildPackages.gnat10;
1123411258 });
11235112591123611260 gnat11 = wrapCC (gcc11.cc.override {
···1123911263 langCC = false;
1124011264 langAda = true;
1124111265 profiledCompiler = false;
1124211242- gnatboot = gnat6;
1126611266+ # As per upstream instructions building a cross compiler
1126711267+ # should be done with a (native) compiler of the same version.
1126811268+ # If we are cross-compiling GNAT, we may as well do the same.
1126911269+ gnatboot =
1127011270+ if stdenv.hostPlatform == stdenv.targetPlatform
1127111271+ && stdenv.buildPlatform == stdenv.hostPlatform
1127211272+ then buildPackages.gnat6
1127311273+ else buildPackages.gnat11;
1124311274 });
11244112751124511276 gnatboot = wrapCC (callPackage ../development/compilers/gnatboot { });
···23127231582312823159 assign-lb-ip = callPackage ../applications/networking/cluster/assign-lb-ip { };
23129231602313023130- astroid = callPackage ../applications/networking/mailreaders/astroid { };
2316123161+ astroid = callPackage ../applications/networking/mailreaders/astroid {
2316223162+ vim = vim_configurable.override { features = "normal"; gui = "auto"; };
2316323163+ };
23131231642313223165 aucatctl = callPackage ../applications/audio/aucatctl { };
2313323166···2315723190 cadence = libsForQt5.callPackage ../applications/audio/cadence { };
23158231912315923192 cheesecutter = callPackage ../applications/audio/cheesecutter { };
2319323193+2319423194+ corefm = libsForQt5.callPackage ../applications/misc/corefm { };
23160231952316123196 milkytracker = callPackage ../applications/audio/milkytracker { };
2316223197