···189 # manually paste it in place. Just symlink.
190 # otherwise, create the target file, ready for users to insert the token
191192- mkdir -p $(dirname ${certmgrAPITokenPath})
193 if [ -f "${cfsslAPITokenPath}" ]; then
194 ln -fs "${cfsslAPITokenPath}" "${certmgrAPITokenPath}"
195 else
···189 # manually paste it in place. Just symlink.
190 # otherwise, create the target file, ready for users to insert the token
191192+ mkdir -p "$(dirname "${certmgrAPITokenPath}")"
193 if [ -f "${cfsslAPITokenPath}" ]; then
194 ln -fs "${cfsslAPITokenPath}" "${certmgrAPITokenPath}"
195 else
+53-39
nixos/modules/services/networking/syncthing.nix
···25 folder.enable
26 ) cfg.declarative.folders);
2728- # get the api key by parsing the config.xml
29- getApiKey = pkgs.writers.writeDash "getAPIKey" ''
30- ${pkgs.libxml2}/bin/xmllint \
31- --xpath 'string(configuration/gui/apikey)'\
32- ${cfg.configDir}/config.xml
33- '';
34-35 updateConfig = pkgs.writers.writeDash "merge-syncthing-config" ''
36 set -efu
37- # wait for syncthing port to open
38- until ${pkgs.curl}/bin/curl -Ss ${cfg.guiAddress} -o /dev/null; do
39- sleep 1
40- done
4142- API_KEY=$(${getApiKey})
43- OLD_CFG=$(${pkgs.curl}/bin/curl -Ss \
44- -H "X-API-Key: $API_KEY" \
45- ${cfg.guiAddress}/rest/system/config)
004647- # generate the new config by merging with the nixos config options
48- NEW_CFG=$(echo "$OLD_CFG" | ${pkgs.jq}/bin/jq -s '.[] as $in | $in * {
49- "devices": (${builtins.toJSON devices}${optionalString (! cfg.declarative.overrideDevices) " + $in.devices"}),
50- "folders": (${builtins.toJSON folders}${optionalString (! cfg.declarative.overrideFolders) " + $in.folders"})
51- }')
00005253- # POST the new config to syncthing
54- echo "$NEW_CFG" | ${pkgs.curl}/bin/curl -Ss \
55- -H "X-API-Key: $API_KEY" \
56- ${cfg.guiAddress}/rest/system/config -d @-
5758- # restart syncthing after sending the new config
59- ${pkgs.curl}/bin/curl -Ss \
60- -H "X-API-Key: $API_KEY" \
61- -X POST \
62- ${cfg.guiAddress}/rest/system/restart
00000000063 '';
64in {
65 ###### interface
···77 type = types.nullOr types.str;
78 default = null;
79 description = ''
80- Path to users cert.pem file, will be copied into the syncthing's
81 <literal>configDir</literal>
82 '';
83 };
···86 type = types.nullOr types.str;
87 default = null;
88 description = ''
89- Path to users key.pem file, will be copied into the syncthing's
90 <literal>configDir</literal>
91 '';
92 };
···105 devices = mkOption {
106 default = {};
107 description = ''
108- Peers/devices which syncthing should communicate with.
109 '';
110 example = {
111 bigbox = {
···168 folders = mkOption {
169 default = {};
170 description = ''
171- folders which should be shared by syncthing.
172 '';
173 example = literalExample ''
174 {
···227 versioning = mkOption {
228 default = null;
229 description = ''
230- How to keep changed/deleted files with syncthing.
231 There are 4 different types of versioning with different parameters.
232 See https://docs.syncthing.net/users/versioning.html
233 '';
···335 upstream's docs</link>.
336 '';
337 };
338-339 };
340 }));
341 };
000000000000342 };
343344 guiAddress = mkOption {
···378 default = null;
379 example = "socks5://address.com:1234";
380 description = ''
381- Overwrites all_proxy environment variable for the syncthing process to
382 the given value. This is normaly used to let relay client connect
383 through SOCKS5 proxy server.
384 '';
···412 Open the default ports in the firewall:
413 - TCP 22000 for transfers
414 - UDP 21027 for discovery
415- 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.
416 Alternatively, if are running only a single instance on this machine using the default ports, enable this.
417 '';
418 };
···431432 imports = [
433 (mkRemovedOptionModule ["services" "syncthing" "useInotify"] ''
434- This option was removed because syncthing now has the inotify functionality included under the name "fswatcher".
435 It can be enabled on a per-folder basis through the webinterface.
436 '')
437 ];
···516 };
517 };
518 syncthing-init = mkIf (
519- cfg.declarative.devices != {} || cfg.declarative.folders != {}
520 ) {
0521 after = [ "syncthing.service" ];
522 wantedBy = [ "multi-user.target" ];
523
···25 folder.enable
26 ) cfg.declarative.folders);
27000000028 updateConfig = pkgs.writers.writeDash "merge-syncthing-config" ''
29 set -efu
00003031+ # get the api key by parsing the config.xml
32+ while
33+ ! api_key=$(${pkgs.libxml2}/bin/xmllint \
34+ --xpath 'string(configuration/gui/apikey)' \
35+ ${cfg.configDir}/config.xml)
36+ do sleep 1; done
3738+ curl() {
39+ while
40+ ${pkgs.curl}/bin/curl -Ss -H "X-API-Key: $api_key" \
41+ --retry 100 --retry-delay 1 --retry-connrefused "$@"
42+ status=$?
43+ [ "$status" -eq 52 ] # retry on empty reply from server
44+ do sleep 1; done
45+ return "$status"
46+ }
4748+ # query the old config
49+ old_cfg=$(curl ${cfg.guiAddress}/rest/config)
005051+ # generate the new config by merging with the NixOS config options
52+ new_cfg=$(echo "$old_cfg" | ${pkgs.jq}/bin/jq -c '. * {
53+ "devices": (${builtins.toJSON devices}${optionalString (! cfg.declarative.overrideDevices) " + .devices"}),
54+ "folders": (${builtins.toJSON folders}${optionalString (! cfg.declarative.overrideFolders) " + .folders"})
55+ } * ${builtins.toJSON cfg.declarative.extraOptions}')
56+57+ # send the new config
58+ curl -X PUT -d "$new_cfg" ${cfg.guiAddress}/rest/config
59+60+ # restart Syncthing if required
61+ if curl ${cfg.guiAddress}/rest/config/restart-required |
62+ ${pkgs.jq}/bin/jq -e .requiresRestart > /dev/null; then
63+ curl -X POST ${cfg.guiAddress}/rest/system/restart
64+ fi
65 '';
66in {
67 ###### interface
···79 type = types.nullOr types.str;
80 default = null;
81 description = ''
82+ Path to users cert.pem file, will be copied into Syncthing's
83 <literal>configDir</literal>
84 '';
85 };
···88 type = types.nullOr types.str;
89 default = null;
90 description = ''
91+ Path to users key.pem file, will be copied into Syncthing's
92 <literal>configDir</literal>
93 '';
94 };
···107 devices = mkOption {
108 default = {};
109 description = ''
110+ Peers/devices which Syncthing should communicate with.
111 '';
112 example = {
113 bigbox = {
···170 folders = mkOption {
171 default = {};
172 description = ''
173+ Folders which should be shared by Syncthing.
174 '';
175 example = literalExample ''
176 {
···229 versioning = mkOption {
230 default = null;
231 description = ''
232+ How to keep changed/deleted files with Syncthing.
233 There are 4 different types of versioning with different parameters.
234 See https://docs.syncthing.net/users/versioning.html
235 '';
···337 upstream's docs</link>.
338 '';
339 };
0340 };
341 }));
342 };
343+344+ extraOptions = mkOption {
345+ type = types.addCheck (pkgs.formats.json {}).type isAttrs;
346+ default = {};
347+ description = ''
348+ Extra configuration options for Syncthing.
349+ '';
350+ example = {
351+ options.localAnnounceEnabled = false;
352+ gui.theme = "black";
353+ };
354+ };
355 };
356357 guiAddress = mkOption {
···391 default = null;
392 example = "socks5://address.com:1234";
393 description = ''
394+ Overwrites all_proxy environment variable for the Syncthing process to
395 the given value. This is normaly used to let relay client connect
396 through SOCKS5 proxy server.
397 '';
···425 Open the default ports in the firewall:
426 - TCP 22000 for transfers
427 - UDP 21027 for discovery
428+ 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.
429 Alternatively, if are running only a single instance on this machine using the default ports, enable this.
430 '';
431 };
···444445 imports = [
446 (mkRemovedOptionModule ["services" "syncthing" "useInotify"] ''
447+ This option was removed because Syncthing now has the inotify functionality included under the name "fswatcher".
448 It can be enabled on a per-folder basis through the webinterface.
449 '')
450 ];
···529 };
530 };
531 syncthing-init = mkIf (
532+ cfg.declarative.devices != {} || cfg.declarative.folders != {} || cfg.declarative.extraOptions != {}
533 ) {
534+ description = "Syncthing configuration updater";
535 after = [ "syncthing.service" ];
536 wantedBy = [ "multi-user.target" ];
537
···7, makeWrapper
8, rsync
9, installShellFiles
01011, components ? [
12 "cmd/kubelet"
···66 install -D build/pause/linux/pause -t $pause/bin
67 installManPage docs/man/man1/*.[1-9]
6869- # Unfortunately, kube-addons-main.sh only looks for the lib file in either the current working dir
70- # or in /opt. We have to patch this for now.
71 substitute cluster/addons/addon-manager/kube-addons-main.sh $out/bin/kube-addons \
72 --subst-var out
73···94 homepage = "https://kubernetes.io";
95 maintainers = with maintainers; [ johanot offline saschagrunert ];
96 platforms = platforms.unix;
000000097 };
98}
···7, makeWrapper
8, rsync
9, installShellFiles
10+, nixosTests
1112, components ? [
13 "cmd/kubelet"
···67 install -D build/pause/linux/pause -t $pause/bin
68 installManPage docs/man/man1/*.[1-9]
6970+ # Unfortunately, kube-addons-main.sh only looks for the lib file in either the
71+ # current working dir or in /opt. We have to patch this for now.
72 substitute cluster/addons/addon-manager/kube-addons-main.sh $out/bin/kube-addons \
73 --subst-var out
74···95 homepage = "https://kubernetes.io";
96 maintainers = with maintainers; [ johanot offline saschagrunert ];
97 platforms = platforms.unix;
98+ };
99+100+ passthru.tests = with nixosTests.kubernetes; {
101+ dns-single-node = dns.singlenode;
102+ dns-multi-node = dns.multinode;
103+ rbac-single-node = rbac.singlenode;
104+ rbac-multi-node = rbac.multinode;
105 };
106}
···3, gtkmm3, libpeas, gsettings-desktop-schemas, gobject-introspection, python3
45# vim to be used, should support the GUI mode.
6-, vim ? vim_configurable.override { features = "normal"; gui = "auto"; }
78# additional python3 packages to be available within plugins
9, extraPythonPackages ? []
···3, gtkmm3, libpeas, gsettings-desktop-schemas, gobject-introspection, python3
45# vim to be used, should support the GUI mode.
6+, vim
78# additional python3 packages to be available within plugins
9, extraPythonPackages ? []
···156157 depsBuildBuild = [ buildPackages.stdenv.cc ];
158 nativeBuildInputs = [ texinfo which gettext ]
159- ++ (optional (perl != null) perl);
00160161 # For building runtime libs
162 depsBuildTarget =
···177 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
178 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
179 ++ (optional hostPlatform.isDarwin gnused)
180- ++ (optional langAda gnatboot)
181 ;
182183 depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
···156157 depsBuildBuild = [ buildPackages.stdenv.cc ];
158 nativeBuildInputs = [ texinfo which gettext ]
159+ ++ (optional (perl != null) perl)
160+ ++ (optional langAda gnatboot)
161+ ;
162163 # For building runtime libs
164 depsBuildTarget =
···179 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
180 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
181 ++ (optional hostPlatform.isDarwin gnused)
0182 ;
183184 depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
+3-2
pkgs/development/compilers/gcc/11/default.nix
···161162 depsBuildBuild = [ buildPackages.stdenv.cc ];
163 nativeBuildInputs = [ texinfo which gettext ]
164- ++ (optional (perl != null) perl);
00165166 # For building runtime libs
167 depsBuildTarget =
···182 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
183 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
184 ++ (optional hostPlatform.isDarwin gnused)
185- ++ (optional langAda gnatboot)
186 ;
187188 depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
···161162 depsBuildBuild = [ buildPackages.stdenv.cc ];
163 nativeBuildInputs = [ texinfo which gettext ]
164+ ++ (optional (perl != null) perl)
165+ ++ (optional langAda gnatboot)
166+ ;
167168 # For building runtime libs
169 depsBuildTarget =
···184 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
185 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
186 ++ (optional hostPlatform.isDarwin gnused)
0187 ;
188189 depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
+3-2
pkgs/development/compilers/gcc/6/default.nix
···199 nativeBuildInputs = [ texinfo which gettext ]
200 ++ (optional (perl != null) perl)
201 ++ (optional javaAwtGtk pkg-config)
202- ++ (optional (with stdenv.targetPlatform; isVc4 || isRedox) flex);
00203204 # For building runtime libs
205 depsBuildTarget =
···222 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
223 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
224 ++ (optional hostPlatform.isDarwin gnused)
225- ++ (optional langAda gnatboot)
226 ;
227228 depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
···199 nativeBuildInputs = [ texinfo which gettext ]
200 ++ (optional (perl != null) perl)
201 ++ (optional javaAwtGtk pkg-config)
202+ ++ (optional (with stdenv.targetPlatform; isVc4 || isRedox) flex)
203+ ++ (optional langAda gnatboot)
204+ ;
205206 # For building runtime libs
207 depsBuildTarget =
···224 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
225 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
226 ++ (optional hostPlatform.isDarwin gnused)
0227 ;
228229 depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
+3-2
pkgs/development/compilers/gcc/9/default.nix
···170171 depsBuildBuild = [ buildPackages.stdenv.cc ];
172 nativeBuildInputs = [ texinfo which gettext ]
173- ++ (optional (perl != null) perl);
00174175 # For building runtime libs
176 depsBuildTarget =
···191 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
192 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
193 ++ (optional hostPlatform.isDarwin gnused)
194- ++ (optional langAda gnatboot)
195 ;
196197 depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
···170171 depsBuildBuild = [ buildPackages.stdenv.cc ];
172 nativeBuildInputs = [ texinfo which gettext ]
173+ ++ (optional (perl != null) perl)
174+ ++ (optional langAda gnatboot)
175+ ;
176177 # For building runtime libs
178 depsBuildTarget =
···193 # The builder relies on GNU sed (for instance, Darwin's `sed' fails with
194 # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it.
195 ++ (optional hostPlatform.isDarwin gnused)
0196 ;
197198 depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
···3334 preConfigure = ''
35 sed -i -e "s|ecwolf.pk3|$out/share/ecwolf/ecwolf.pk3|" src/version.h
000036 '';
3738 # Install the required PK3 file in the required data directory
···46 homepage = "https://maniacsvault.net/ecwolf/";
47 license = licenses.gpl2Plus;
48 maintainers = with maintainers; [ sander ];
49- # Darwin is untested (supported by upstream)
50 platforms = platforms.all;
51 };
52}
···3334 preConfigure = ''
35 sed -i -e "s|ecwolf.pk3|$out/share/ecwolf/ecwolf.pk3|" src/version.h
36+ ''
37+ # Disable app bundle creation on Darwin. It fails, and it is not needed to run it from the Nix store
38+ + lib.optionalString (stdenv.isDarwin) ''
39+ sed -i -e "s|include(\''${CMAKE_CURRENT_SOURCE_DIR}/macosx/install.txt)||" src/CMakeLists.txt
40 '';
4142 # Install the required PK3 file in the required data directory
···50 homepage = "https://maniacsvault.net/ecwolf/";
51 license = licenses.gpl2Plus;
52 maintainers = with maintainers; [ sander ];
053 platforms = platforms.all;
54 };
55}
···39143915 corehunt = libsForQt5.callPackage ../applications/misc/corehunt { };
39163917+ coretoppings = libsForQt5.callPackage ../applications/misc/coretoppings { };
3918+3919 certstrap = callPackage ../tools/security/certstrap { };
39203921 cfssl = callPackage ../tools/security/cfssl { };
···11214 langCC = false;
11215 langAda = true;
11216 profiledCompiler = false;
11217+ # As per upstream instructions building a cross compiler
11218+ # should be done with a (native) compiler of the same version.
11219+ # If we are cross-compiling GNAT, we may as well go the same
11220+ # route (especially as gnatboot can't cross-compile).
11221+ gnatboot =
11222+ if stdenv.hostPlatform == stdenv.targetPlatform
11223+ && stdenv.buildPlatform == stdenv.hostPlatform
11224+ then buildPackages.gnatboot
11225+ else buildPackages.gnat6;
11226 });
1122711228 gnat9 = wrapCC (gcc9.cc.override {
···11231 langCC = false;
11232 langAda = true;
11233 profiledCompiler = false;
11234+ # As per upstream instructions building a cross compiler
11235+ # should be done with a (native) compiler of the same version.
11236+ # If we are cross-compiling GNAT, we may as well do the same.
11237+ gnatboot =
11238+ if stdenv.hostPlatform == stdenv.targetPlatform
11239+ && stdenv.buildPlatform == stdenv.hostPlatform
11240+ then buildPackages.gnat6
11241+ else buildPackages.gnat9;
11242 });
1124311244 gnat10 = wrapCC (gcc10.cc.override {
···11247 langCC = false;
11248 langAda = true;
11249 profiledCompiler = false;
11250+ # As per upstream instructions building a cross compiler
11251+ # should be done with a (native) compiler of the same version.
11252+ # If we are cross-compiling GNAT, we may as well do the same.
11253+ gnatboot =
11254+ if stdenv.hostPlatform == stdenv.targetPlatform
11255+ && stdenv.buildPlatform == stdenv.hostPlatform
11256+ then buildPackages.gnat6
11257+ else buildPackages.gnat10;
11258 });
1125911260 gnat11 = wrapCC (gcc11.cc.override {
···11263 langCC = false;
11264 langAda = true;
11265 profiledCompiler = false;
11266+ # As per upstream instructions building a cross compiler
11267+ # should be done with a (native) compiler of the same version.
11268+ # If we are cross-compiling GNAT, we may as well do the same.
11269+ gnatboot =
11270+ if stdenv.hostPlatform == stdenv.targetPlatform
11271+ && stdenv.buildPlatform == stdenv.hostPlatform
11272+ then buildPackages.gnat6
11273+ else buildPackages.gnat11;
11274 });
1127511276 gnatboot = wrapCC (callPackage ../development/compilers/gnatboot { });
···2315823159 assign-lb-ip = callPackage ../applications/networking/cluster/assign-lb-ip { };
2316023161+ astroid = callPackage ../applications/networking/mailreaders/astroid {
23162+ vim = vim_configurable.override { features = "normal"; gui = "auto"; };
23163+ };
2316423165 aucatctl = callPackage ../applications/audio/aucatctl { };
23166···23190 cadence = libsForQt5.callPackage ../applications/audio/cadence { };
2319123192 cheesecutter = callPackage ../applications/audio/cheesecutter { };
23193+23194+ corefm = libsForQt5.callPackage ../applications/misc/corefm { };
2319523196 milkytracker = callPackage ../applications/audio/milkytracker { };
23197