···377378- [Nginx virtual hosts](#opt-services.nginx.virtualHosts) using `forceSSL` or
379 `globalRedirect` can now have redirect codes other than 301 through
000380 `redirectCode`.
381382- `libjxl` 0.9.0 [dropped support for the butteraugli API](https://github.com/libjxl/libjxl/pull/2576). You will no longer be able to set `enableButteraugli` on `libaom`.
···377378- [Nginx virtual hosts](#opt-services.nginx.virtualHosts) using `forceSSL` or
379 `globalRedirect` can now have redirect codes other than 301 through
380+381+- `bacula` now allows to configure `TLS` for encrypted communication.
382+383 `redirectCode`.
384385- `libjxl` 0.9.0 [dropped support for the butteraugli API](https://github.com/libjxl/libjxl/pull/2576). You will no longer be able to set `enableButteraugli` on `libaom`.
+186-36
nixos/modules/services/backup/bacula.nix
···4# TODO: test configuration when building nixexpr (use -t parameter)
5# TODO: support sqlite3 (it's deprecate?) and mysql
67-with lib;
89let
0000000000010 libDir = "/var/lib/bacula";
1100000000000000012 fd_cfg = config.services.bacula-fd;
13 fd_conf = pkgs.writeText "bacula-fd.conf"
14 ''
···18 WorkingDirectory = ${libDir};
19 Pid Directory = /run;
20 ${fd_cfg.extraClientConfig}
021 }
2223 ${concatStringsSep "\n" (mapAttrsToList (name: value: ''
···25 Name = "${name}";
26 Password = ${value.password};
27 Monitor = ${value.monitor};
028 }
29 '') fd_cfg.director)}
30···44 WorkingDirectory = ${libDir};
45 Pid Directory = /run;
46 ${sd_cfg.extraStorageConfig}
047 }
4849 ${concatStringsSep "\n" (mapAttrsToList (name: value: ''
···70 Name = "${name}";
71 Password = ${value.password};
72 Monitor = ${value.monitor};
073 }
74 '') sd_cfg.director)}
75···90 Working Directory = ${libDir};
91 Pid Directory = /run/;
92 QueryFile = ${pkgs.bacula}/etc/query.sql;
093 ${dir_cfg.extraDirectorConfig}
94 }
95···108 ${dir_cfg.extraConfig}
109 '';
110111- directorOptions = {...}:
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000112 {
113 options = {
114 password = mkOption {
115 type = types.str;
116 # TODO: required?
117- description = lib.mdDoc ''
118 Specifies the password that must be supplied for the default Bacula
119 Console to be authorized. The same password must appear in the
120 Director resource of the Console configuration file. For added
···135 type = types.enum [ "no" "yes" ];
136 default = "no";
137 example = "yes";
138- description = lib.mdDoc ''
139 If Monitor is set to `no`, this director will have
140 full access to this Storage daemon. If Monitor is set to
141 `yes`, this director will only be able to fetch the
···146 security problems.
147 '';
148 };
0000000149 };
150 };
151···154 options = {
155 changerDevice = mkOption {
156 type = types.str;
157- description = lib.mdDoc ''
158 The specified name-string must be the generic SCSI device name of the
159 autochanger that corresponds to the normal read/write Archive Device
160 specified in the Device resource. This generic SCSI device name
···173174 changerCommand = mkOption {
175 type = types.str;
176- description = lib.mdDoc ''
177 The name-string specifies an external program to be called that will
178 automatically change volumes as required by Bacula. Normally, this
179 directive will be specified only in the AutoChanger resource, which
···195 };
196197 devices = mkOption {
198- description = lib.mdDoc "";
199 type = types.listOf types.str;
200 };
201202 extraAutochangerConfig = mkOption {
203 default = "";
204 type = types.lines;
205- description = lib.mdDoc ''
206 Extra configuration to be passed in Autochanger directive.
207 '';
208 example = ''
···219 archiveDevice = mkOption {
220 # TODO: required?
221 type = types.str;
222- description = lib.mdDoc ''
223 The specified name-string gives the system file name of the storage
224 device managed by this storage daemon. This will usually be the
225 device file name of a removable storage device (tape drive), for
···236 mediaType = mkOption {
237 # TODO: required?
238 type = types.str;
239- description = lib.mdDoc ''
240 The specified name-string names the type of media supported by this
241 device, for example, `DLT7000`. Media type names are
242 arbitrary in that you set them to anything you want, but they must be
···274 extraDeviceConfig = mkOption {
275 default = "";
276 type = types.lines;
277- description = lib.mdDoc ''
278 Extra configuration to be passed in Device directive.
279 '';
280 example = ''
···295 enable = mkOption {
296 type = types.bool;
297 default = false;
298- description = lib.mdDoc ''
299 Whether to enable the Bacula File Daemon.
300 '';
301 };
···304 default = "${config.networking.hostName}-fd";
305 defaultText = literalExpression ''"''${config.networking.hostName}-fd"'';
306 type = types.str;
307- description = lib.mdDoc ''
308 The client name that must be used by the Director when connecting.
309 Generally, it is a good idea to use a name related to the machine so
310 that error messages can be easily identified if you have multiple
···315 port = mkOption {
316 default = 9102;
317 type = types.port;
318- description = lib.mdDoc ''
319 This specifies the port number on which the Client listens for
320 Director connections. It must agree with the FDPort specified in
321 the Client resource of the Director's configuration file.
···324325 director = mkOption {
326 default = {};
327- description = lib.mdDoc ''
328 This option defines director resources in Bacula File Daemon.
329 '';
330- type = with types; attrsOf (submodule directorOptions);
331 };
3320000000000333 extraClientConfig = mkOption {
334 default = "";
335 type = types.lines;
336- description = lib.mdDoc ''
337 Extra configuration to be passed in Client directive.
338 '';
339 example = ''
···345 extraMessagesConfig = mkOption {
346 default = "";
347 type = types.lines;
348- description = lib.mdDoc ''
349 Extra configuration to be passed in Messages directive.
350 '';
351 example = ''
···358 enable = mkOption {
359 type = types.bool;
360 default = false;
361- description = lib.mdDoc ''
362 Whether to enable Bacula Storage Daemon.
363 '';
364 };
···367 default = "${config.networking.hostName}-sd";
368 defaultText = literalExpression ''"''${config.networking.hostName}-sd"'';
369 type = types.str;
370- description = lib.mdDoc ''
371 Specifies the Name of the Storage daemon.
372 '';
373 };
···375 port = mkOption {
376 default = 9103;
377 type = types.port;
378- description = lib.mdDoc ''
379 Specifies port number on which the Storage daemon listens for
380 Director connections.
381 '';
···383384 director = mkOption {
385 default = {};
386- description = lib.mdDoc ''
387 This option defines Director resources in Bacula Storage Daemon.
388 '';
389- type = with types; attrsOf (submodule directorOptions);
390 };
391392 device = mkOption {
393 default = {};
394- description = lib.mdDoc ''
395 This option defines Device resources in Bacula Storage Daemon.
396 '';
397- type = with types; attrsOf (submodule deviceOptions);
398 };
399400 autochanger = mkOption {
401 default = {};
402- description = lib.mdDoc ''
403 This option defines Autochanger resources in Bacula Storage Daemon.
404 '';
405- type = with types; attrsOf (submodule autochangerOptions);
406 };
407408 extraStorageConfig = mkOption {
409 default = "";
410 type = types.lines;
411- description = lib.mdDoc ''
412 Extra configuration to be passed in Storage directive.
413 '';
414 example = ''
···420 extraMessagesConfig = mkOption {
421 default = "";
422 type = types.lines;
423- description = lib.mdDoc ''
424 Extra configuration to be passed in Messages directive.
425 '';
426 example = ''
427 console = all
428 '';
429 };
00000000430431 };
432···434 enable = mkOption {
435 type = types.bool;
436 default = false;
437- description = lib.mdDoc ''
438 Whether to enable Bacula Director Daemon.
439 '';
440 };
···443 default = "${config.networking.hostName}-dir";
444 defaultText = literalExpression ''"''${config.networking.hostName}-dir"'';
445 type = types.str;
446- description = lib.mdDoc ''
447 The director name used by the system administrator. This directive is
448 required.
449 '';
···452 port = mkOption {
453 default = 9101;
454 type = types.port;
455- description = lib.mdDoc ''
456 Specify the port (a positive integer) on which the Director daemon
457 will listen for Bacula Console connections. This same port number
458 must be specified in the Director resource of the Console
···465 password = mkOption {
466 # TODO: required?
467 type = types.str;
468- description = lib.mdDoc ''
469 Specifies the password that must be supplied for a Director.
470 '';
471 };
···473 extraMessagesConfig = mkOption {
474 default = "";
475 type = types.lines;
476- description = lib.mdDoc ''
477 Extra configuration to be passed in Messages directive.
478 '';
479 example = ''
···484 extraDirectorConfig = mkOption {
485 default = "";
486 type = types.lines;
487- description = lib.mdDoc ''
488 Extra configuration to be passed in Director directive.
489 '';
490 example = ''
···496 extraConfig = mkOption {
497 default = "";
498 type = types.lines;
499- description = lib.mdDoc ''
500 Extra configuration for Bacula Director Daemon.
501 '';
502 example = ''
503 TODO
504 '';
505 };
000000000506 };
507 };
508
···4# TODO: test configuration when building nixexpr (use -t parameter)
5# TODO: support sqlite3 (it's deprecate?) and mysql
6078let
9+ inherit (lib)
10+ concatStringsSep
11+ literalExpression
12+ mapAttrsToList
13+ mdDoc
14+ mkIf
15+ mkOption
16+ optional
17+ optionalString
18+ types
19+ ;
20 libDir = "/var/lib/bacula";
2122+ yes_no = bool: if bool then "yes" else "no";
23+ tls_conf = tls_cfg: optionalString tls_cfg.enable (
24+ concatStringsSep
25+ "\n"
26+ (
27+ ["TLS Enable = yes;"]
28+ ++ optional (tls_cfg.require != null) "TLS Require = ${yes_no tls_cfg.require};"
29+ ++ optional (tls_cfg.certificate != null) ''TLS Certificate = "${tls_cfg.certificate}";''
30+ ++ [''TLS Key = "${tls_cfg.key}";'']
31+ ++ optional (tls_cfg.verifyPeer != null) "TLS Verify Peer = ${yes_no tls_cfg.verifyPeer};"
32+ ++ optional (tls_cfg.allowedCN != [ ]) "TLS Allowed CN = ${concatStringsSep " " (tls_cfg.allowedCN)};"
33+ ++ optional (tls_cfg.caCertificateFile != null) ''TLS CA Certificate File = "${tls_cfg.caCertificateFile}";''
34+ )
35+ );
36+37 fd_cfg = config.services.bacula-fd;
38 fd_conf = pkgs.writeText "bacula-fd.conf"
39 ''
···43 WorkingDirectory = ${libDir};
44 Pid Directory = /run;
45 ${fd_cfg.extraClientConfig}
46+ ${tls_conf fd_cfg.tls}
47 }
4849 ${concatStringsSep "\n" (mapAttrsToList (name: value: ''
···51 Name = "${name}";
52 Password = ${value.password};
53 Monitor = ${value.monitor};
54+ ${tls_conf value.tls}
55 }
56 '') fd_cfg.director)}
57···71 WorkingDirectory = ${libDir};
72 Pid Directory = /run;
73 ${sd_cfg.extraStorageConfig}
74+ ${tls_conf sd_cfg.tls}
75 }
7677 ${concatStringsSep "\n" (mapAttrsToList (name: value: ''
···98 Name = "${name}";
99 Password = ${value.password};
100 Monitor = ${value.monitor};
101+ ${tls_conf value.tls}
102 }
103 '') sd_cfg.director)}
104···119 Working Directory = ${libDir};
120 Pid Directory = /run/;
121 QueryFile = ${pkgs.bacula}/etc/query.sql;
122+ ${tls_conf dir_cfg.tls}
123 ${dir_cfg.extraDirectorConfig}
124 }
125···138 ${dir_cfg.extraConfig}
139 '';
140141+ linkOption = name: destination: "[${name}](#opt-${builtins.replaceStrings [ "<" ">"] ["_" "_"] destination})";
142+ tlsLink = destination: submodulePath: linkOption "${submodulePath}.${destination}" "${submodulePath}.${destination}";
143+144+ tlsOptions = submodulePath: {...}:
145+ {
146+ options = {
147+ enable = mkOption {
148+ type = types.bool;
149+ default = false;
150+ description = mdDoc ''
151+ Specifies if TLS should be enabled.
152+ If this set to `false` TLS will be completely disabled, even if ${tlsLink "tls.require" submodulePath} is true.
153+ '';
154+ };
155+ require = mkOption {
156+ type = types.nullOr types.bool;
157+ default = null;
158+ description = mdDoc ''
159+ Require TLS or TLS-PSK encryption.
160+ This directive is ignored unless one of ${tlsLink "tls.enable" submodulePath} is true or TLS PSK Enable is set to `yes`.
161+ If TLS is not required while TLS or TLS-PSK are enabled, then the Bacula component
162+ will connect with other components either with or without TLS or TLS-PSK
163+164+ If ${tlsLink "tls.enable" submodulePath} or TLS-PSK is enabled and TLS is required, then the Bacula
165+ component will refuse any connection request that does not use TLS.
166+ '';
167+ };
168+ certificate = mkOption {
169+ type = types.nullOr types.path;
170+ default = null;
171+ description = mdDoc ''
172+ The full path to the PEM encoded TLS certificate.
173+ It will be used as either a client or server certificate,
174+ depending on the connection direction.
175+ This directive is required in a server context, but it may
176+ not be specified in a client context if ${tlsLink "tls.verifyPeer" submodulePath} is
177+ `false` in the corresponding server context.
178+ '';
179+ };
180+ key = mkOption {
181+ type = types.path;
182+ description = mdDoc ''
183+ The path of a PEM encoded TLS private key.
184+ It must correspond to the TLS certificate.
185+ '';
186+ };
187+ verifyPeer = mkOption {
188+ type = types.nullOr types.bool;
189+ default = null;
190+ description = mdDoc ''
191+ Verify peer certificate.
192+ Instructs server to request and verify the client's X.509 certificate.
193+ Any client certificate signed by a known-CA will be accepted.
194+ Additionally, the client's X509 certificate Common Name must meet the value of the Address directive.
195+ If ${tlsLink "tls.allowedCN" submodulePath} is used,
196+ the client's x509 certificate Common Name must also correspond to
197+ one of the CN specified in the ${tlsLink "tls.allowedCN" submodulePath} directive.
198+ This directive is valid only for a server and not in client context.
199+200+ Standard from Bacula is `true`.
201+ '';
202+ };
203+ allowedCN = mkOption {
204+ type = types.listOf types.str;
205+ default = [ ];
206+ description = mdDoc ''
207+ Common name attribute of allowed peer certificates.
208+ This directive is valid for a server and in a client context.
209+ If this directive is specified, the peer certificate will be verified against this list.
210+ In the case this directive is configured on a server side, the allowed
211+ CN list will not be checked if ${tlsLink "tls.verifyPeer" submodulePath} is false.
212+ '';
213+ };
214+ caCertificateFile = mkOption {
215+ type = types.nullOr types.path;
216+ default = null;
217+ description = mdDoc ''
218+ The path specifying a PEM encoded TLS CA certificate(s).
219+ Multiple certificates are permitted in the file.
220+ One of TLS CA Certificate File or TLS CA Certificate Dir are required in a server context, unless
221+ ${tlsLink "tls.verifyPeer" submodulePath} is false, and are always required in a client context.
222+ '';
223+ };
224+ };
225+ };
226+227+ directorOptions = submodulePath:{...}:
228 {
229 options = {
230 password = mkOption {
231 type = types.str;
232 # TODO: required?
233+ description = mdDoc ''
234 Specifies the password that must be supplied for the default Bacula
235 Console to be authorized. The same password must appear in the
236 Director resource of the Console configuration file. For added
···251 type = types.enum [ "no" "yes" ];
252 default = "no";
253 example = "yes";
254+ description = mdDoc ''
255 If Monitor is set to `no`, this director will have
256 full access to this Storage daemon. If Monitor is set to
257 `yes`, this director will only be able to fetch the
···262 security problems.
263 '';
264 };
265+266+ tls = mkOption {
267+ type = types.submodule (tlsOptions "${submodulePath}.director.<name>");
268+ description = mdDoc ''
269+ TLS Options for the Director in this Configuration.
270+ '';
271+ };
272 };
273 };
274···277 options = {
278 changerDevice = mkOption {
279 type = types.str;
280+ description = mdDoc ''
281 The specified name-string must be the generic SCSI device name of the
282 autochanger that corresponds to the normal read/write Archive Device
283 specified in the Device resource. This generic SCSI device name
···296297 changerCommand = mkOption {
298 type = types.str;
299+ description = mdDoc ''
300 The name-string specifies an external program to be called that will
301 automatically change volumes as required by Bacula. Normally, this
302 directive will be specified only in the AutoChanger resource, which
···318 };
319320 devices = mkOption {
321+ description = mdDoc "";
322 type = types.listOf types.str;
323 };
324325 extraAutochangerConfig = mkOption {
326 default = "";
327 type = types.lines;
328+ description = mdDoc ''
329 Extra configuration to be passed in Autochanger directive.
330 '';
331 example = ''
···342 archiveDevice = mkOption {
343 # TODO: required?
344 type = types.str;
345+ description = mdDoc ''
346 The specified name-string gives the system file name of the storage
347 device managed by this storage daemon. This will usually be the
348 device file name of a removable storage device (tape drive), for
···359 mediaType = mkOption {
360 # TODO: required?
361 type = types.str;
362+ description = mdDoc ''
363 The specified name-string names the type of media supported by this
364 device, for example, `DLT7000`. Media type names are
365 arbitrary in that you set them to anything you want, but they must be
···397 extraDeviceConfig = mkOption {
398 default = "";
399 type = types.lines;
400+ description = mdDoc ''
401 Extra configuration to be passed in Device directive.
402 '';
403 example = ''
···418 enable = mkOption {
419 type = types.bool;
420 default = false;
421+ description = mdDoc ''
422 Whether to enable the Bacula File Daemon.
423 '';
424 };
···427 default = "${config.networking.hostName}-fd";
428 defaultText = literalExpression ''"''${config.networking.hostName}-fd"'';
429 type = types.str;
430+ description = mdDoc ''
431 The client name that must be used by the Director when connecting.
432 Generally, it is a good idea to use a name related to the machine so
433 that error messages can be easily identified if you have multiple
···438 port = mkOption {
439 default = 9102;
440 type = types.port;
441+ description = mdDoc ''
442 This specifies the port number on which the Client listens for
443 Director connections. It must agree with the FDPort specified in
444 the Client resource of the Director's configuration file.
···447448 director = mkOption {
449 default = {};
450+ description = mdDoc ''
451 This option defines director resources in Bacula File Daemon.
452 '';
453+ type = types.attrsOf (types.submodule (directorOptions "services.bacula-fd"));
454 };
455456+457+ tls = mkOption {
458+ type = types.submodule (tlsOptions "services.bacula-fd");
459+ default = { };
460+ description = mdDoc ''
461+ TLS Options for the File Daemon.
462+ Important notice: The backup won't be encrypted.
463+ '';
464+ };
465+466 extraClientConfig = mkOption {
467 default = "";
468 type = types.lines;
469+ description = mdDoc ''
470 Extra configuration to be passed in Client directive.
471 '';
472 example = ''
···478 extraMessagesConfig = mkOption {
479 default = "";
480 type = types.lines;
481+ description = mdDoc ''
482 Extra configuration to be passed in Messages directive.
483 '';
484 example = ''
···491 enable = mkOption {
492 type = types.bool;
493 default = false;
494+ description = mdDoc ''
495 Whether to enable Bacula Storage Daemon.
496 '';
497 };
···500 default = "${config.networking.hostName}-sd";
501 defaultText = literalExpression ''"''${config.networking.hostName}-sd"'';
502 type = types.str;
503+ description = mdDoc ''
504 Specifies the Name of the Storage daemon.
505 '';
506 };
···508 port = mkOption {
509 default = 9103;
510 type = types.port;
511+ description = mdDoc ''
512 Specifies port number on which the Storage daemon listens for
513 Director connections.
514 '';
···516517 director = mkOption {
518 default = {};
519+ description = mdDoc ''
520 This option defines Director resources in Bacula Storage Daemon.
521 '';
522+ type = types.attrsOf (types.submodule (directorOptions "services.bacula-sd"));
523 };
524525 device = mkOption {
526 default = {};
527+ description = mdDoc ''
528 This option defines Device resources in Bacula Storage Daemon.
529 '';
530+ type = types.attrsOf (types.submodule deviceOptions);
531 };
532533 autochanger = mkOption {
534 default = {};
535+ description = mdDoc ''
536 This option defines Autochanger resources in Bacula Storage Daemon.
537 '';
538+ type = types.attrsOf (types.submodule autochangerOptions);
539 };
540541 extraStorageConfig = mkOption {
542 default = "";
543 type = types.lines;
544+ description = mdDoc ''
545 Extra configuration to be passed in Storage directive.
546 '';
547 example = ''
···553 extraMessagesConfig = mkOption {
554 default = "";
555 type = types.lines;
556+ description = mdDoc ''
557 Extra configuration to be passed in Messages directive.
558 '';
559 example = ''
560 console = all
561 '';
562 };
563+ tls = mkOption {
564+ type = types.submodule (tlsOptions "services.bacula-sd");
565+ default = { };
566+ description = mdDoc ''
567+ TLS Options for the Storage Daemon.
568+ Important notice: The backup won't be encrypted.
569+ '';
570+ };
571572 };
573···575 enable = mkOption {
576 type = types.bool;
577 default = false;
578+ description = mdDoc ''
579 Whether to enable Bacula Director Daemon.
580 '';
581 };
···584 default = "${config.networking.hostName}-dir";
585 defaultText = literalExpression ''"''${config.networking.hostName}-dir"'';
586 type = types.str;
587+ description = mdDoc ''
588 The director name used by the system administrator. This directive is
589 required.
590 '';
···593 port = mkOption {
594 default = 9101;
595 type = types.port;
596+ description = mdDoc ''
597 Specify the port (a positive integer) on which the Director daemon
598 will listen for Bacula Console connections. This same port number
599 must be specified in the Director resource of the Console
···606 password = mkOption {
607 # TODO: required?
608 type = types.str;
609+ description = mdDoc ''
610 Specifies the password that must be supplied for a Director.
611 '';
612 };
···614 extraMessagesConfig = mkOption {
615 default = "";
616 type = types.lines;
617+ description = mdDoc ''
618 Extra configuration to be passed in Messages directive.
619 '';
620 example = ''
···625 extraDirectorConfig = mkOption {
626 default = "";
627 type = types.lines;
628+ description = mdDoc ''
629 Extra configuration to be passed in Director directive.
630 '';
631 example = ''
···637 extraConfig = mkOption {
638 default = "";
639 type = types.lines;
640+ description = mdDoc ''
641 Extra configuration for Bacula Director Daemon.
642 '';
643 example = ''
644 TODO
645 '';
646 };
647+648+ tls = mkOption {
649+ type = types.submodule (tlsOptions "services.bacula-dir");
650+ default = { };
651+ description = mdDoc ''
652+ TLS Options for the Director.
653+ Important notice: The backup won't be encrypted.
654+ '';
655+ };
656 };
657 };
658
···2021preInstallPhases+=" addGnustepInstallFlags"
2223-addEnvVars() {
24 local filename
25000000000000000000026 for filename in $1/share/GNUstep/Makefiles/Additional/*.make ; do
27- if case "${NIX_GNUSTEP_MAKEFILES_ADDITIONAL-}" in *"{$filename}"*) false;; *) true;; esac; then
28- export NIX_GNUSTEP_MAKEFILES_ADDITIONAL+=" $filename"
29- fi
30 done
3132- local tmp="$1/lib/GNUstep/Applications"
33- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_APPS-}" in *"${tmp}"*) false;; *) true;; esac; then
34- addToSearchPath NIX_GNUSTEP_SYSTEM_APPS "$tmp"
35- fi
36- tmp="$1/lib/GNUstep/Applications"
37- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_ADMIN_APPS-}" in *"${tmp}"*) false;; *) true;; esac; then
38- addToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_APPS "$tmp"
39- fi
40- tmp="$1/lib/GNUstep/WebApplications"
41- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_WEB_APPS-}" in *"${tmp}"*) false;; *) true;; esac; then
42- addToSearchPath NIX_GNUSTEP_SYSTEM_WEB_APPS "$tmp"
43- fi
44- tmp="$1/bin"
45- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_TOOLS-}" in *"${tmp}"*) false;; *) true;; esac; then
46- addToSearchPath NIX_GNUSTEP_SYSTEM_TOOLS "$tmp"
47- fi
48- tmp="$1/sbin"
49- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS-}" in *"${tmp}"*) false;; *) true;; esac; then
50- addToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS "$tmp"
51- fi
52- tmp="$1/lib/GNUstep"
53- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_LIBRARY-}" in *"${tmp}"*) false;; *) true;; esac; then
54- addToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARY "$tmp"
55- fi
56- tmp="$1/include"
57- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_HEADERS-}" in *"${tmp}"*) false;; *) true;; esac; then
58- if [ -z "${NIX_GNUSTEP_SYSTEM_HEADERS-}" ]; then
59- export NIX_GNUSTEP_SYSTEM_HEADERS="$tmp"
60- else
61- export NIX_GNUSTEP_SYSTEM_HEADERS+=" $tmp"
62- fi
63- fi
64- tmp="$1/lib"
65- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_LIBRARIES-}" in *"${tmp}"*) false;; *) true;; esac; then
66- addToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARIES "$tmp"
67- fi
68- tmp="$1/share/GNUstep/Documentation"
69- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_DOC-}" in *"${tmp}"*) false;; *) true;; esac; then
70- addToSearchPath NIX_GNUSTEP_SYSTEM_DOC "$tmp"
71- fi
72- tmp="$1/share/man"
73- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_DOC_MAN-}" in *"${tmp}"*) false;; *) true;; esac; then
74- addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_MAN "$tmp"
75- fi
76- tmp="$1/share/info"
77- if [ -d "$tmp" ] && case "${NIX_GNUSTEP_SYSTEM_DOC_INFO-}" in *"${tmp}"*) false;; *) true;; esac; then
78- addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_INFO "$tmp"
79- fi
80}
81-addEnvHooks "$targetOffset" addEnvVars
00000000
···2021preInstallPhases+=" addGnustepInstallFlags"
2223+addGNUstepEnvVars() {
24 local filename
2526+ gsAddToSearchPath() {
27+ if [[ -d "$2" && "${!1-}" != *"$2"* ]]; then
28+ addToSearchPath "$1" "$2"
29+ fi
30+ }
31+32+ gsAddToIncludeSearchPath() {
33+ local -n ref="$1"
34+35+ # NOTE: contrary to the one in wrapGNUstepAppsHook, use -e here instead of -d since it's also used for the makefiles
36+ if [[ -e "$2" && "${ref-}" != *"$2"* ]]; then
37+ if [[ "${ref-}" != "" ]]; then
38+ ref+=" "
39+ fi
40+41+ ref+="$2"
42+ fi
43+ }
44+45 for filename in $1/share/GNUstep/Makefiles/Additional/*.make ; do
46+ gsAddToIncludeSearchPath NIX_GNUSTEP_MAKEFILES_ADDITIONAL "$filename"
0047 done
4849+ export NIX_GNUSTEP_MAKEFILES_ADDITIONAL
50+51+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_APPS "$1/lib/GNUstep/Applications"
52+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_APPS "$1/lib/GNUstep/Applications"
53+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_WEB_APPS "$1/lib/GNUstep/WebApplications"
54+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_TOOLS "$1/bin"
55+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_ADMIN_TOOLS "$1/sbin"
56+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARY "$1/lib/GNUstep"
57+ gsAddToIncludeSearchPath NIX_GNUSTEP_SYSTEM_HEADERS "$1/include"
58+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_LIBRARIES "$1/lib"
59+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_DOC "$1/share/GNUstep/Documentation"
60+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_DOC_MAN "$1/share/man"
61+ gsAddToSearchPath NIX_GNUSTEP_SYSTEM_DOC_INFO "$1/share/info"
0000000000000000000000000000000000062}
63+addEnvHooks "$targetOffset" addGNUstepEnvVars
64+65+gsmakeSetup() {
66+ export GNUSTEP_MAKEFILES="$(gnustep-config --variable=GNUSTEP_MAKEFILES)"
67+68+ . $GNUSTEP_MAKEFILES/GNUstep.sh
69+}
70+71+preConfigureHooks+=(gsmakeSetup)
···1-diff --git a/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java b/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java
2-index 6fff2af..7e2877e 100644
3---- a/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java
4-+++ b/src/main/java/com/google/devtools/build/lib/exec/local/PosixLocalEnvProvider.java
5-@@ -47,6 +47,16 @@ public final class PosixLocalEnvProvider implements LocalEnvProvider {
6- Map<String, String> env, BinTools binTools, String fallbackTmpDir) {
7- ImmutableMap.Builder<String, String> result = ImmutableMap.builder();
8- result.putAll(Maps.filterKeys(env, k -> !k.equals("TMPDIR")));
9-+
10-+ // In case we are running on NixOS.
11-+ // If bash is called with an unset PATH on this platform,
12-+ // it will set it to /no-such-path and default tools will be missings.
13-+ // See, https://github.com/NixOS/nixpkgs/issues/94222
14-+ // So we ensure that minimal dependencies are present.
15-+ if (!env.containsKey("PATH")){
16-+ result.put("PATH", "@actionsPathPatch@");
17-+ }
18-+
19- String p = clientEnv.get("TMPDIR");
20- if (Strings.isNullOrEmpty(p)) {
21- // Do not use `fallbackTmpDir`, use `/tmp` instead. This way if the user didn't export TMPDIR
22-index 95642767c6..39d3c62461 100644
23---- a/src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java
24-+++ b/src/main/java/com/google/devtools/build/lib/exec/local/XcodeLocalEnvProvider.java
25-@@ -74,6 +74,16 @@ public final class XcodeLocalEnvProvider implements LocalEnvProvider {
26-27- ImmutableMap.Builder<String, String> newEnvBuilder = ImmutableMap.builder();
28- newEnvBuilder.putAll(Maps.filterKeys(env, k -> !k.equals("TMPDIR")));
29-+
30-+ // In case we are running on NixOS.
31-+ // If bash is called with an unset PATH on this platform,
32-+ // it will set it to /no-such-path and default tools will be missings.
33-+ // See, https://github.com/NixOS/nixpkgs/issues/94222
34-+ // So we ensure that minimal dependencies are present.
35-+ if (!env.containsKey("PATH")){
36-+ newEnvBuilder.put("PATH", "@actionsPathPatch@");
37-+ }
38-+
39- String p = clientEnv.get("TMPDIR");
40- if (Strings.isNullOrEmpty(p)) {
41- // Do not use `fallbackTmpDir`, use `/tmp` instead. This way if the user didn't export TMPDIR
···1-#!/usr/bin/env python3
2-import sys
3-import json
4-5-if len(sys.argv) != 2:
6- print("usage: ./this-script src-deps.json < WORKSPACE", file=sys.stderr)
7- print("Takes the bazel WORKSPACE file and reads all archives into a json dict (by evaling it as python code)", file=sys.stderr)
8- print("Hail Eris.", file=sys.stderr)
9- sys.exit(1)
10-11-http_archives = []
12-13-# just the kw args are the dict { name, sha256, urls … }
14-def http_archive(**kw):
15- http_archives.append(kw)
16-# like http_file
17-def http_file(**kw):
18- http_archives.append(kw)
19-20-# this is inverted from http_archive/http_file and bundles multiple archives
21-def distdir_tar(**kw):
22- for archive_name in kw['archives']:
23- http_archives.append({
24- "name": archive_name,
25- "sha256": kw['sha256'][archive_name],
26- "urls": kw['urls'][archive_name]
27- })
28-29-# TODO?
30-def git_repository(**kw):
31- print(json.dumps(kw, sort_keys=True, indent=4), file=sys.stderr)
32- sys.exit(1)
33-34-# execute the WORKSPACE like it was python code in this module,
35-# using all the function stubs from above.
36-exec(sys.stdin.read())
37-38-# transform to a dict with the names as keys
39-d = { el['name']: el for el in http_archives }
40-41-def has_urls(el):
42- return ('url' in el and el['url']) or ('urls' in el and el['urls'])
43-def has_sha256(el):
44- return 'sha256' in el and el['sha256']
45-bad_archives = list(filter(lambda el: not has_urls(el) or not has_sha256(el), d.values()))
46-if bad_archives:
47- print('Following bazel dependencies are missing url or sha256', file=sys.stderr)
48- print('Check bazel sources for master or non-checksummed dependencies', file=sys.stderr)
49- for el in bad_archives:
50- print(json.dumps(el, sort_keys=True, indent=4), file=sys.stderr)
51- sys.exit(1)
52-53-with open(sys.argv[1], "w") as f:
54- print(json.dumps(d, sort_keys=True, indent=4), file=f)
···2, buildPythonPackage
3, fetchPypi
4, brotli
05, certifi
6, ffmpeg
7, rtmpdump
···9, pycryptodomex
10, websockets
11, mutagen
012, secretstorage
013, atomicparsleySupport ? true
14, ffmpegSupport ? true
15, rtmpSupport ? true
···22 # The websites yt-dlp deals with are a very moving target. That means that
23 # downloads break constantly. Because of that, updates should always be backported
24 # to the latest stable release.
25- version = "2023.12.30";
02627 src = fetchPypi {
28- inherit pname version;
29- hash = "sha256-oRhi5XchsKDwiD3+taTXm6ITotTEXhiA6f1w+OZXDDg=";
030 };
00003132 propagatedBuildInputs = [
33 brotli
34 certifi
35 mutagen
36 pycryptodomex
037 secretstorage # "optional", as in not in requirements.txt, needed for `--cookies-from-browser`
038 websockets
39 ];
40···48 ++ lib.optional atomicparsleySupport atomicparsley
49 ++ lib.optional ffmpegSupport ffmpeg
50 ++ lib.optional rtmpSupport rtmpdump;
51- in lib.optionalString (packagesToBinPath != [])
52 [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ];
5354 setupPyBuildFlags = [
···2, buildPythonPackage
3, fetchPypi
4, brotli
5+, hatchling
6, certifi
7, ffmpeg
8, rtmpdump
···10, pycryptodomex
11, websockets
12, mutagen
13+, requests
14, secretstorage
15+, urllib3
16, atomicparsleySupport ? true
17, ffmpegSupport ? true
18, rtmpSupport ? true
···25 # The websites yt-dlp deals with are a very moving target. That means that
26 # downloads break constantly. Because of that, updates should always be backported
27 # to the latest stable release.
28+ version = "2024.3.10";
29+ pyproject = true;
3031 src = fetchPypi {
32+ inherit version;
33+ pname = "yt_dlp";
34+ hash = "sha256-bnTLFKadvrhyyO9OC4u+0u6EbsYzUTzzEkp0wfrtwHs=";
35 };
36+37+ nativeBuildInputs = [
38+ hatchling
39+ ];
4041 propagatedBuildInputs = [
42 brotli
43 certifi
44 mutagen
45 pycryptodomex
46+ requests
47 secretstorage # "optional", as in not in requirements.txt, needed for `--cookies-from-browser`
48+ urllib3
49 websockets
50 ];
51···59 ++ lib.optional atomicparsleySupport atomicparsley
60 ++ lib.optional ffmpegSupport ffmpeg
61 ++ lib.optional rtmpSupport rtmpdump;
62+ in lib.optionals (packagesToBinPath != [])
63 [ ''--prefix PATH : "${lib.makeBinPath packagesToBinPath}"'' ];
6465 setupPyBuildFlags = [
+1
pkgs/top-level/aliases.nix
···97 bashInteractive_5 = bashInteractive; # Added 2021-08-20
98 bash_5 = bash; # Added 2021-08-20
99 bazel_3 = throw "bazel 3 is past end of life as it is not an lts version"; # Added 2023-02-02
0100 bedup = throw "bedup was removed because it was broken and abandoned upstream"; # added 2023-02-04
101 bee-unstable = throw "bee-unstable has been removed, use 'bee' instead"; # Added 2024-02-12
102 bee-clef = throw "bee-clef has been removed as the upstream project was archived"; # Added 2024-02-12
···97 bashInteractive_5 = bashInteractive; # Added 2021-08-20
98 bash_5 = bash; # Added 2021-08-20
99 bazel_3 = throw "bazel 3 is past end of life as it is not an lts version"; # Added 2023-02-02
100+ bazel_4 = throw "'bazel_4' has been removed from nixpkgs as it has reached end of life"; # Added 2024-01-23
101 bedup = throw "bedup was removed because it was broken and abandoned upstream"; # added 2023-02-04
102 bee-unstable = throw "bee-unstable has been removed, use 'bee' instead"; # Added 2024-02-12
103 bee-clef = throw "bee-clef has been removed as the upstream project was archived"; # Added 2024-02-12