]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - flakes/private/environment/flake.nix
Move dilion user to private
[perso/Immae/Config/Nix.git] / flakes / private / environment / flake.nix
CommitLineData
1a64deeb
IB
1{
2 outputs = { self }: {
3 nixosModule = self.nixosModules.environment;
4 nixosModules.environment = { config, lib, name, ... }:
5 with lib;
6 with types;
7 with lists;
8 let
9 ldapOptions = {
10 base = mkOption { description = "Base of the LDAP tree"; type = str; };
11 host = mkOption { description = "Host to access LDAP"; type = str; };
12 root_dn = mkOption { description = "DN of the root user"; type = str; };
13 root_pw = mkOption { description = "Hashed password of the root user"; type = str; };
14 replication_dn = mkOption { description = "DN of the user allowed to replicate the LDAP directory"; type = str; };
15 replication_pw = mkOption { description = "Password of the user allowed to replicate the LDAP directory"; type = str; };
16 };
17 mkLdapOptions = name: more: mkOption {
18 description = "${name} LDAP configuration";
19 type = submodule {
20 options = ldapOptions // {
21 dn = mkOption { description = "DN of the ${name} user"; type = str; };
22 password = mkOption { description = "password of the ${name} user"; type = str; };
23 filter = mkOption { description = "Filter for ${name} users"; type = str; default = ""; };
24 } // more;
25 };
26 };
27 mysqlOptions = {
28 host = mkOption { description = "Host to access Mysql"; type = str; };
29 remoteHost = mkOption { description = "Host to access Mysql from outside"; type = str; };
30 port = mkOption { description = "Port to access Mysql"; type = int; };
31 socket = mkOption { description = "Socket to access Mysql"; type = path; };
32 systemUsers = mkOption {
33 description = "Attrs of user-passwords allowed to access mysql";
34 type = attrsOf str;
35 };
36 pam = mkOption {
37 description = "PAM configuration for mysql";
38 type = submodule {
39 options = {
40 dn = mkOption { description = "DN to connect as to check users"; type = str; };
41 password = mkOption { description = "DN password to connect as to check users"; type = str; };
42 filter = mkOption { description = "filter to match users"; type = str; };
43 };
44 };
45 };
46 };
47 mkMysqlOptions = name: more: mkOption {
48 description = "${name} mysql configuration";
49 type = submodule {
50 options = mysqlOptions // {
51 database = mkOption { description = "${name} database"; type = str; };
52 user = mkOption { description = "${name} user"; type = str; };
53 password = mkOption { description = "mysql password of the ${name} user"; type = str; };
54 } // more;
55 };
56 };
57 psqlOptions = {
58 host = mkOption { description = "Host to access Postgresql"; type = str; };
59 port = mkOption { description = "Port to access Postgresql"; type = str; };
60 socket = mkOption { description = "Socket to access Postgresql"; type = path; };
61 pam = mkOption {
62 description = "PAM configuration for psql";
63 type = submodule {
64 options = {
65 dn = mkOption { description = "DN to connect as to check users"; type = str; };
66 password = mkOption { description = "DN password to connect as to check users"; type = str; };
67 filter = mkOption { description = "filter to match users"; type = str; };
68 };
69 };
70 };
71 };
72 mkPsqlOptions = name: mkOption {
73 description = "${name} psql configuration";
74 type = submodule {
75 options = psqlOptions // {
76 database = mkOption { description = "${name} database"; type = str; };
77 schema = mkOption { description = "${name} schema"; type = nullOr str; default = null; };
78 user = mkOption { description = "${name} user"; type = str; };
79 password = mkOption { description = "psql password of the ${name} user"; type = str; };
80 };
81 };
82 };
83 redisOptions = {
84 host = mkOption { description = "Host to access Redis"; type = str; };
85 port = mkOption { description = "Port to access Redis"; type = str; };
86 socket = mkOption { description = "Socket to access Redis"; type = path; };
87 dbs = mkOption {
88 description = "Attrs of db number. Each number should be unique to avoid collision!";
89 type = attrsOf str;
90 };
91 spiped_key = mkOption {
92 type = str;
93 description = ''
94 Key to use with spiped to make a secure channel to replication
95 '';
96 };
97 predixy = mkOption {
98 description = "Predixy configuration. Unused yet";
99 type = submodule {
100 options = {
101 read = mkOption { type = str; description = "Read password"; };
102 };
103 };
104 };
105 };
106 mkRedisOptions = name: mkOption {
107 description = "${name} redis configuration";
108 type = submodule {
109 options = redisOptions // {
110 db = mkOption { description = "${name} database"; type = str; };
111 };
112 };
113 };
114 smtpOptions = {
115 host = mkOption { description = "Host to access SMTP"; type = str; };
116 port = mkOption { description = "Port to access SMTP"; type = str; };
117 };
118 mkSmtpOptions = name: mkOption {
119 description = "${name} smtp configuration";
120 type = submodule {
121 options = smtpOptions // {
122 email = mkOption { description = "${name} email"; type = str; };
123 password = mkOption { description = "SMTP password of the ${name} user"; type = str; };
124 };
125 };
126 };
127 hostEnv = submodule {
128 options = {
129 fqdn = mkOption {
130 description = "Host FQDN";
131 type = str;
132 };
133 hostKey = mkOption {
134 type = nullOr str;
135 default = null;
136 description = ''
137 ssh host key
138 '';
139 };
140 isVm = mkEnableOption "The host is a vm";
1a64deeb
IB
141 emails = mkOption {
142 default = [];
143 description = "List of e-mails that the server can be a sender of";
144 type = listOf str;
145 };
146 ldap = mkOption {
147 description = ''
148 LDAP credentials for the host
149 '';
150 type = submodule {
151 options = {
152 password = mkOption { type = str; description = "Password for the LDAP connection"; };
153 dn = mkOption { type = str; description = "DN for the LDAP connection"; };
154 };
155 };
156 };
157 mx = mkOption {
158 description = "subdomain and priority for MX server";
159 default = { enable = false; };
160 type = submodule {
161 options = {
162 enable = mkEnableOption "Enable MX";
163 subdomain = mkOption { type = nullOr str; description = "Subdomain name (mx-*)"; };
164 priority = mkOption { type = nullOr int; description = "Priority"; };
165 };
166 };
167 };
168 ips = mkOption {
169 description = ''
170 attrs of ip4/ip6 grouped by section
171 '';
172 type = attrsOf (submodule {
173 options = {
174 alias = mkOption {
175 type = nullOr str;
176 default = null;
177 description = ''
178 alias to use in DNS for that group
179 '';
180 };
181 ip4 = mkOption {
182 type = listOf str;
183 default = [];
184 description = ''
185 ip4 addresses of the host
186 '';
187 };
188 ip6 = mkOption {
189 type = listOf str;
190 default = [];
191 description = ''
192 ip6 addresses of the host
193 '';
194 };
195 };
196 });
197 };
198 };
199 };
200 in
201 {
202 # Necessary for situations where flake gets included multiple times
203 key = builtins.hashString "sha256" (builtins.path { path = self.sourceInfo.outPath; name = "source"; });
204
205 options.myEnv = {
206 servers = mkOption {
207 description = ''
208 Attrs of servers information in the cluster (not necessarily handled by nixops)
209 '';
210 default = {};
211 type = attrsOf hostEnv;
212 };
213 hetznerCloud = mkOption {
214 description = ''
215 Hetzner Cloud credential information
216 '';
217 type = submodule {
218 options = {
219 authToken = mkOption {
220 type = str;
221 description = ''
222 The API auth token.
223 '';
224 };
225 };
226 };
227 };
228 hetzner = mkOption {
229 description = ''
230 Hetzner credential information
231 '';
232 type = submodule {
233 options = {
234 user = mkOption { type = str; description = "User"; };
235 pass = mkOption { type = str; description = "Password"; };
236 };
237 };
238 };
239 sshd = mkOption {
240 description = ''
241 sshd service credential information
242 '';
243 type = submodule {
244 options = {
245 rootKeys = mkOption { type = attrsOf str; description = "Keys of root users"; };
246 ldap = mkOption {
247 description = ''
248 LDAP credentials for cn=ssh,ou=services,dc=immae,dc=eu dn
249 '';
250 type = submodule {
251 options = {
252 password = mkOption { description = "Password"; type = str; };
253 };
254 };
255 };
256 psql = mkOption {
257 description = ''
258 PSQL credentials for immae_auth_read
259 '';
260 type = submodule {
261 options = {
262 password = mkOption { description = "Password"; type = str; };
263 };
264 };
265 };
266 };
267 };
268 };
269 ports = mkOption {
270 description = ''
271 non-standard reserved ports. Must be unique!
272 '';
273 type = attrsOf port;
274 default = {};
275 apply = let
276 noDupl = x: builtins.length (builtins.attrValues x) == builtins.length (unique (builtins.attrValues x));
277 in
278 x: if isAttrs x && noDupl x then x else throw "Non unique values for ports";
279 };
280 httpd = mkOption {
281 description = ''
282 httpd service credential information
283 '';
284 type = submodule {
285 options = {
286 ldap = mkOption {
287 description = ''
288 LDAP credentials for cn=httpd,ou=services,dc=immae,dc=eu dn
289 '';
290 type = submodule {
291 options = {
292 password = mkOption { description = "Password"; type = str; };
293 };
294 };
295 };
296 };
297 };
298 };
299 smtp = mkOption {
300 type = submodule { options = smtpOptions; };
301 description = "SMTP configuration";
302 };
303 ldap = mkOption {
304 description = ''
305 LDAP server configuration
306 '';
307 type = submodule {
308 options = ldapOptions;
309 };
310 };
311 databases = mkOption {
312 description = "Databases configuration";
313 type = submodule {
314 options = {
315 mysql = mkOption {
316 type = submodule { options = mysqlOptions; };
317 description = "Mysql configuration";
318 };
319 redis = mkOption {
320 type = submodule { options = redisOptions; };
321 description = "Redis configuration";
322 };
323 postgresql = mkOption {
324 type = submodule { options = psqlOptions; };
325 description = "Postgresql configuration";
326 };
327 };
328 };
329 };
330 jabber = mkOption {
331 description = "Jabber configuration";
332 type = submodule {
333 options = {
334 postfix_user_filter = mkOption { type = str; description = "Postfix filter to get xmpp users"; };
335 ldap = mkLdapOptions "Jabber" {};
336 postgresql = mkPsqlOptions "Jabber";
337 };
338 };
339 };
1a64deeb
IB
340 users = mkOption {
341 description = "System and regular users uid/gid";
342 type = attrsOf (submodule {
343 options = {
344 uid = mkOption {
345 description = "user uid";
346 type = int;
347 };
348 gid = mkOption {
349 description = "user gid";
350 type = int;
351 };
352 };
353 });
354 };
355 dns = mkOption {
356 description = "DNS configuration";
357 type = submodule {
358 options = {
359 ns = mkOption {
360 description = "Attrs of NS servers group";
361 example = {
362 foo = {
363 "ns1.foo.com" = [ "198.51.100.10" "2001:db8:abcd::1" ];
364 "ns2.foo.com" = [ "198.51.100.15" "2001:db8:1234::1" ];
365 };
366 };
367 type = attrsOf (attrsOf (listOf str));
368 };
369 };
370 };
371 };
372 backup = mkOption {
373 description = ''
374 Remote backup with duplicity
375 '';
376 type = submodule {
377 options = {
378 password = mkOption { type = str; description = "Password for encrypting files"; };
379 remotes = mkOption {
380 type = attrsOf (submodule {
381 options = {
382 remote = mkOption {
383 type = functionTo str;
384 example = literalExample ''
385 bucket: "s3://some_host/${bucket}";
386 '';
387 description = ''
388 Function.
389 Takes a bucket name as argument and returns a url
390 '';
391 };
392 accessKeyId = mkOption { type = str; description = "Remote access-key"; };
393 secretAccessKey = mkOption { type = str; description = "Remote access secret"; };
394 };
395 });
396 };
397 };
398 };
399 };
400 zrepl_backup = mkOption {
401 type = submodule {
402 options = {
403 ssh_key = mkOption {
404 description = "SSH key information";
405 type = submodule {
406 options = {
407 public = mkOption { type = str; description = "Public part of the key"; };
408 private = mkOption { type = lines; description = "Private part of the key"; };
409 };
410 };
411 };
412 mysql = mkMysqlOptions "Zrepl" {};
413 certs = mkOption {
414 description = "Certificates";
415 type = attrsOf (submodule {
416 options = {
417 key = mkOption { type = str; description = "Key"; };
418 certificate = mkOption { type = str; description = "Certificate"; };
419 };
420 });
421 };
422 };
423 };
424 };
425 rsync_backup = mkOption {
426 description =''
427 Rsync backup configuration from controlled host
428 '';
429 type = submodule {
430 options = {
431 ssh_key = mkOption {
432 description = "SSH key information";
433 type = submodule {
434 options = {
435 public = mkOption { type = str; description = "Public part of the key"; };
436 private = mkOption { type = lines; description = "Private part of the key"; };
437 };
438 };
439 };
440 profiles = mkOption {
441 description = "Attrs of profiles to backup";
442 default = {};
443 type = attrsOf (submodule {
444 options = {
445 keep = mkOption { type = int; description = "Number of backups to keep"; };
446 check_command = mkOption { type = str; description = "command to check if backup needs to be done"; default = "backup"; };
447 login = mkOption { type = str; description = "Login to connect to host"; };
448 port = mkOption { type = str; default = "22"; description = "Port to connect to host"; };
449 host = mkOption { type = str; description = "Host to connect to"; };
450 host_key = mkOption { type = str; description = "Host key"; };
451 host_key_type = mkOption { type = str; description = "Host key type"; };
452 parts = mkOption {
453 description = "Parts to backup for this host";
454 type = attrsOf (submodule {
455 options = {
456 remote_folder = mkOption { type = path; description = "Remote folder to backup";};
457 exclude_from = mkOption {
458 type = listOf path;
459 default = [];
460 description = "List of folders/files to exclude from the backup";
461 };
462 files_from = mkOption {
463 type = listOf path;
464 default = [];
465 description = "List of folders/files to backup in the base folder";
466 };
467 args = mkOption {
468 type = nullOr str;
469 default = null;
470 description = "Extra arguments to pass to rsync";
471 };
472 };
473 });
474 };
475 };
476 });
477 };
478 };
479 };
480 };
481 monitoring = mkOption {
482 description = "Monitoring configuration";
483 type = submodule {
484 options = {
485 status_url = mkOption { type = str; description = "URL to push status to"; };
486 status_token = mkOption { type = str; description = "Token for the status url"; };
487 http_user_password = mkOption { type = str; description = "HTTP credentials to check services behind wall"; };
488 email = mkOption { type = str; description = "Admin E-mail"; };
489 ssh_public_key = mkOption { type = str; description = "SSH public key"; };
490 ssh_secret_key = mkOption { type = str; description = "SSH secret key"; };
491 imap_login = mkOption { type = str; description = "IMAP login"; };
492 imap_password = mkOption { type = str; description = "IMAP password"; };
493 eriomem_keys = mkOption { type = listOf (listOf str); description = "Eriomem keys"; default = []; };
494 ovh_sms = mkOption {
495 description = "OVH credentials for sms script";
496 type = submodule {
497 options = {
498 endpoint = mkOption { type = str; default = "ovh-eu"; description = "OVH endpoint"; };
499 application_key = mkOption { type = str; description = "Application key"; };
500 application_secret = mkOption { type = str; description = "Application secret"; };
501 consumer_key = mkOption { type = str; description = "Consumer key"; };
502 account = mkOption { type = str; description = "Account"; };
503 };
504 };
505 };
506 nrdp_tokens = mkOption { type = listOf str; description = "Tokens allowed to push status update"; };
507 apprise_urls = mkOption { type = str; description = "Apprise space-separated urls to push status update"; };
508 netdata_aggregator = mkOption { type = str; description = "Url where netdata information should be sent"; };
509 netdata_keys = mkOption { type = attrsOf str; description = "netdata host keys"; };
510 immae_contact = mkOption { type = str; description = "Immae Contact e-mail"; };
511 email_check = mkOption {
512 description = "Emails services to check";
513 type = attrsOf (submodule {
514 options = {
515 local = mkOption { type = bool; default = false; description = "Use local configuration"; };
516 port = mkOption { type = nullOr str; default = null; description = "Port to connect to ssh"; };
517 login = mkOption { type = nullOr str; default = null; description = "Login to connect to ssh"; };
518 targets = mkOption { type = listOf str; description = "Hosts to send E-mails to"; };
519 mail_address = mkOption { type = nullOr str; default = null; description = "E-mail recipient part to send e-mail to"; };
520 mail_domain = mkOption { type = nullOr str; default = null; description = "E-mail domain part to send e-mail to"; };
521 };
522 });
523 };
524 };
525 };
526 };
527 mpd = mkOption {
528 description = "MPD configuration";
529 type = submodule {
530 options = {
531 folder = mkOption { type = str; description = "Folder to serve from the MPD instance"; };
532 password = mkOption { type = str; description = "Password to connect to the MPD instance"; };
533 host = mkOption { type = str; description = "Host to connect to the MPD instance"; };
534 port = mkOption { type = str; description = "Port to connect to the MPD instance"; };
535 };
536 };
537 };
538 ftp = mkOption {
539 description = "FTP configuration";
540 type = submodule {
541 options = {
542 ldap = mkLdapOptions "FTP" {
543 proftpd_filter = mkOption { type = str; description = "Filter for proftpd listing in LDAP"; };
544 pure-ftpd_filter = mkOption { type = str; description = "Filter for pure-ftpd listing in LDAP"; };
545 };
546 };
547 };
548 };
549 vpn = mkOption {
550 description = "VPN configuration";
551 type = attrsOf (submodule {
552 options = {
553 prefix = mkOption { type = str; description = "ipv6 prefix for the vpn subnet"; };
554 privateKey = mkOption { type = str; description = "Private key for the host"; };
555 publicKey = mkOption { type = str; description = "Public key for the host"; };
556 };
557 });
558 };
559 mail = mkOption {
560 description = "Mail configuration";
561 type = submodule {
562 options = {
563 dmarc = mkOption {
564 description = "DMARC configuration";
565 type = submodule {
566 options = {
567 ignore_hosts = mkOption {
568 type = lines;
569 description = ''
570 Hosts to ignore when checking for dmarc
571 '';
572 };
573 };
574 };
575 };
576 dkim = mkOption {
577 description = "DKIM configuration";
578 type = attrsOf (submodule {
579 options = {
580 public = mkOption {
581 type = attrsOf str;
582 example = literalExample ''
583 {
584 v = "DKIM1";
585 k = "rsa";
586 p = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3w1a2aMxWw9+hdcmbqX4UevcVqr204y0K73Wdc7MPZiOOlUJQYsMNSYR1Y/SC7jmPKeitpcJCpQgn/cveJZbuikjjPLsDReHyFEYmC278ZLRTELHx6f1IXM8WE08JIRT69CfZiMi1rVcOh9qRT4F93PyjCauU8Y5hJjtg9ThsWwIDAQAB";
587 }
588 '';
589 description = "Public entry to put in DNS TXT field";
590 };
591 private = mkOption { type = nullOr str; default = null; description = "Private key"; };
592 };
593 });
594 };
595 postfix = mkOption {
596 description = "Postfix configuration";
597 type = submodule {
598 options = {
599 mysql = mkMysqlOptions "Postfix" {
600 password_encrypt = mkOption { type = str; description = "Key to encrypt relay password in database"; };
601 };
602 admins = mkOption {
603 description = ''
604 List of admins meant to receive common aliases
605 '';
606 type = listOf str;
607 };
608 common_aliases = mkOption {
609 description = ''
610 List of aliases common to all hosts, to forward to admins
611 '';
612 type = listOf str;
613 };
614 other_aliases = mkOption {
615 description = ''
616 Other list of aliases, to forward to admins
617 '';
618 type = listOf str;
619 };
620 };
621 };
622 };
623 dovecot = mkOption {
624 description = "Dovecot configuration";
625 type = submodule {
626 options = {
627 ldap = mkLdapOptions "Dovecot" {
628 pass_attrs = mkOption { type = str; description = "Password attribute in LDAP"; };
629 user_attrs = mkOption { type = str; description = "User attribute mapping in LDAP"; };
630 iterate_attrs = mkOption { type = str; description = "User attribute mapping for listing in LDAP"; };
631 iterate_filter = mkOption { type = str; description = "User attribute filter for listing in LDAP"; };
632 postfix_mailbox_filter = mkOption { type = str; description = "Postfix filter to get mailboxes"; };
633 };
634 };
635 };
636 };
637 rspamd = mkOption {
638 description = "rspamd configuration";
639 type = submodule {
640 options = {
641 redis = mkRedisOptions "Redis";
642 read_password_hashed = mkOption { type = str; description = "Hashed read password for rspamd"; };
643 write_password_hashed = mkOption { type = str; description = "Hashed write password for rspamd"; };
644 read_password = mkOption {
645 type = str;
646 description = "Read password for rspamd. Unused";
647 apply = x: "";
648 };
649 write_password = mkOption {
650 type = str;
651 description = "Write password for rspamd. Unused";
652 apply = x: "";
653 };
654 };
655 };
656 };
657 sympa = mkOption {
658 description = "Sympa configuration";
659 type = submodule {
660 options = {
661 listmasters = mkOption {
662 type = listOf str;
663 description = "Listmasters";
664 };
665 postgresql = mkPsqlOptions "Sympa";
666 data_sources = mkOption {
667 type = attrsOf str;
668 default = {};
669 description = "Data sources to make available to sympa";
670 };
671 scenari = mkOption {
672 type = attrsOf str;
673 default = {};
674 description = "Scenari to make available to sympa";
675 };
676 };
677 };
678 };
679 };
680 };
681 };
682 coturn = mkOption {
683 description = "Coturn configuration";
684 type = submodule {
685 options = {
686 auth_access_key = mkOption { type = str; description = "key to access coturn"; };
687 };
688 };
689 };
690 buildbot = mkOption {
691 description = "Buildbot configuration";
692 type = submodule {
693 options = {
694 ssh_key = mkOption {
695 description = "SSH key information";
696 type = submodule {
697 options = {
698 public = mkOption { type = str; description = "Public part of the key"; };
699 private = mkOption { type = lines; description = "Private part of the key"; };
700 };
701 };
702 };
703 workerPassword = mkOption { description = "Buildbot worker password"; type = str; };
704 user = mkOption {
705 description = "Buildbot user";
706 type = submodule {
707 options = {
708 uid = mkOption {
709 description = "user uid";
710 type = int;
711 };
712 gid = mkOption {
713 description = "user gid";
714 type = int;
715 };
716 };
717 };
718 };
719 ldap = mkOption {
720 description = "Ldap configuration for buildbot";
721 type = submodule {
722 options = {
723 password = mkOption { type = str; description = "Buildbot password"; };
724 };
725 };
726 };
727 projects = mkOption {
728 description = "Projects to make a buildbot for";
729 type = attrsOf (submodule {
730 options = {
731 name = mkOption { type = str; description = "Project name"; };
732 src = mkOption { type = path; description = "source of the project configuration"; };
733 packages = mkOption {
734 type = listOf package;
735 example = literalExample ''
736 [ pkgs.bash pkgs.git pkgs.gzip pkgs.openssh ];
737 '';
738 description = ''
739 Builds packages list to make available to buildbot project.
740 '';
741 };
742 pythonPathHome = mkOption { type = bool; description = "Whether to add project’s python home to python path"; };
743 workerPort = mkOption { type = port; description = "Port for the worker"; };
744 secrets = mkOption {
745 type = attrsOf lines;
746 description = "Secrets for the project to dump as files";
747 };
748 secretsDeps = mkOption {
749 type = listOf package;
750 default = [];
751 description = "Dependencies of file that will land in secrets";
752 };
753 environment = mkOption {
754 type = attrsOf str;
755 description = ''
756 Environment variables for the project.
757 BUILDBOT_ is prefixed to the variable names
758 '';
759 };
760 activationScript = mkOption {
761 type = lines;
762 description = ''
763 Activation script to run during deployment
764 '';
765 };
766 webhookTokens = mkOption {
767 type = nullOr (listOf str);
768 default = null;
769 description = ''
770 List of tokens allowed to push to project’s change_hook/base endpoint
771 '';
772 };
773 };
774 });
775 };
776 };
777 };
778 };
779 tools = mkOption {
780 description = "Tools configurations";
781 type = submodule {
782 options = {
783 contact = mkOption { type = str; description = "Contact e-mail address"; };
784 assets = mkOption {
785 default = {};
786 type = attrsOf (submodule {
787 options = {
788 assetType = mkOption { type = enum ["tgz" "url" "googleFont"]; default = "url"; description = "Type of asset"; };
789 tgzRemoveComponents = mkOption { type = int; default = 0; description = "Remove components when extracting"; };
790 url = mkOption { type = str; description = "URL to fetch"; };
791 sha256 = mkOption { type = str; description = "Hash of the url"; };
792 };
793 });
794 description = "Assets to provide on assets.immae.eu";
795 };
796 davical = mkOption {
797 description = "Davical configuration";
798 type = submodule {
799 options = {
800 postgresql = mkPsqlOptions "Davical";
801 ldap = mkLdapOptions "Davical" {};
802 };
803 };
804 };
805 diaspora = mkOption {
806 description = "Diaspora configuration";
807 type = submodule {
808 options = {
809 postgresql = mkPsqlOptions "Diaspora";
810 redis = mkRedisOptions "Diaspora";
811 ldap = mkLdapOptions "Diaspora" {};
812 secret_token = mkOption { type = str; description = "Secret token"; };
813 };
814 };
815 };
816 dmarc_reports = mkOption {
817 description = "DMARC reports configuration";
818 type = submodule {
819 options = {
820 mysql = mkMysqlOptions "DMARC" {};
821 anonymous_key = mkOption { type = str; description = "Anonymous hashing key"; };
822 };
823 };
824 };
825 etherpad-lite = mkOption {
826 description = "Etherpad configuration";
827 type = submodule {
828 options = {
829 postgresql = mkPsqlOptions "Etherpad";
830 ldap = mkLdapOptions "Etherpad" {
831 group_filter = mkOption { type = str; description = "Filter for groups"; };
832 };
833 adminPassword = mkOption { type = str; description = "Admin password for mypads / admin"; };
834 session_key = mkOption { type = str; description = "Session key"; };
835 api_key = mkOption { type = str; description = "API key"; };
836 };
837 };
838 };
839 gitolite = mkOption {
840 description = "Gitolite configuration";
841 type = submodule {
842 options = {
843 ldap = mkLdapOptions "Gitolite" {};
844 ssh_key = mkOption {
845 description = "SSH key information";
846 type = submodule {
847 options = {
848 public = mkOption { type = str; description = "Public part of the key"; };
849 private = mkOption { type = lines; description = "Private part of the key"; };
850 };
851 };
852 };
853 };
854 };
855 };
856 landing = mkOption {
857 description = "Landing configuration";
858 type = submodule {
859 options = {
860 postgresql = mkPsqlOptions "Landing";
861 };
862 };
863 };
864 kanboard = mkOption {
865 description = "Kanboard configuration";
866 type = submodule {
867 options = {
868 postgresql = mkPsqlOptions "Kanboard";
869 ldap = mkLdapOptions "Kanboard" {
870 admin_dn = mkOption { type = str; description = "Admin DN"; };
871 };
872 };
873 };
874 };
875 mantisbt = mkOption {
876 description = "Mantisbt configuration";
877 type = submodule {
878 options = {
879 postgresql = mkPsqlOptions "Mantisbt";
880 ldap = mkLdapOptions "Mantisbt" {};
881 master_salt = mkOption { type = str; description = "Master salt for password hash"; };
882 };
883 };
884 };
885 mastodon = mkOption {
886 description = "Mastodon configuration";
887 type = submodule {
888 options = {
889 postgresql = mkPsqlOptions "Mastodon";
890 redis = mkRedisOptions "Mastodon";
891 ldap = mkLdapOptions "Mastodon" {};
892 paperclip_secret = mkOption { type = str; description = "Paperclip secret"; };
893 otp_secret = mkOption { type = str; description = "OTP secret"; };
894 secret_key_base = mkOption { type = str; description = "Secret key base"; };
895 vapid = mkOption {
896 description = "vapid key";
897 type = submodule {
898 options = {
899 private = mkOption { type = str; description = "Private key"; };
900 public = mkOption { type = str; description = "Public key"; };
901 };
902 };
903 };
904 };
905 };
906 };
907 mediagoblin = mkOption {
908 description = "Mediagoblin configuration";
909 type = submodule {
910 options = {
911 postgresql = mkPsqlOptions "Mediagoblin";
912 redis = mkRedisOptions "Mediagoblin";
913 ldap = mkLdapOptions "Mediagoblin" {};
914 };
915 };
916 };
917 nextcloud = mkOption {
918 description = "Nextcloud configuration";
919 type = submodule {
920 options = {
921 postgresql = mkPsqlOptions "Nextcloud";
922 redis = mkRedisOptions "Nextcloud";
923 password_salt = mkOption { type = str; description = "Password salt"; };
924 instance_id = mkOption { type = str; description = "Instance ID"; };
925 secret = mkOption { type = str; description = "App secret"; };
926 };
927 };
928 };
929 peertube = mkOption {
930 description = "Peertube configuration";
931 type = submodule {
932 options = {
933 listenPort = mkOption { type = port; description = "Port to listen to"; };
934 postgresql = mkPsqlOptions "Peertube";
935 redis = mkRedisOptions "Peertube";
936 ldap = mkLdapOptions "Peertube" {};
937 };
938 };
939 };
940 phpldapadmin = mkOption {
941 description = "phpLdapAdmin configuration";
942 type = submodule {
943 options = {
944 ldap = mkLdapOptions "phpldapadmin" {};
945 };
946 };
947 };
948 rompr = mkOption {
949 description = "Rompr configuration";
950 type = submodule {
951 options = {
952 mpd = mkOption {
953 description = "MPD configuration";
954 type = submodule {
955 options = {
956 host = mkOption { type = str; description = "Host for MPD"; };
957 port = mkOption { type = port; description = "Port to access MPD host"; };
958 };
959 };
960 };
961 };
962 };
963 };
964 roundcubemail = mkOption {
965 description = "Roundcubemail configuration";
966 type = submodule {
967 options = {
968 postgresql = mkPsqlOptions "TT-RSS";
969 secret = mkOption { type = str; description = "Secret"; };
970 };
971 };
972 };
973 shaarli = mkOption {
974 description = "Shaarli configuration";
975 type = submodule {
976 options = {
977 ldap = mkLdapOptions "Shaarli" {};
978 };
979 };
980 };
981 status_engine = mkOption {
982 description = "Status Engine configuration";
983 type = submodule {
984 options = {
985 mysql = mkMysqlOptions "StatusEngine" {};
986 ldap = mkLdapOptions "StatusEngine" {};
987 };
988 };
989 };
990 task = mkOption {
991 description = "Taskwarrior configuration";
992 type = submodule {
993 options = {
994 ldap = mkLdapOptions "Taskwarrior" {};
995 taskwarrior-web = mkOption {
996 description = "taskwarrior-web profiles";
997 default = {};
998 type = attrsOf (submodule {
999 options = {
1000 uid = mkOption {
1001 type = listOf str;
1002 description = "List of ldap uids having access to this profile";
1003 };
1004 org = mkOption { type = str; description = "Taskd organisation"; };
1005 key = mkOption { type = str; description = "Taskd key"; };
1006 date = mkOption { type = str; description = "Preferred date format"; };
1007 };
1008 });
1009 };
1010 };
1011 };
1012 };
1013 ttrss = mkOption {
1014 description = "TT-RSS configuration";
1015 type = submodule {
1016 options = {
1017 postgresql = mkPsqlOptions "TT-RSS";
1018 ldap = mkLdapOptions "TT-RSS" {};
1019 };
1020 };
1021 };
1022 wallabag = mkOption {
1023 description = "Wallabag configuration";
1024 type = submodule {
1025 options = {
1026 postgresql = mkPsqlOptions "Wallabag";
1027 ldap = mkLdapOptions "Wallabag" {
1028 admin_filter = mkOption { type = str; description = "Admin users filter"; };
1029 };
1030 redis = mkRedisOptions "Wallabag";
1031 secret = mkOption { type = str; description = "App secret"; };
1032 };
1033 };
1034 };
1035 webhooks = mkOption {
1036 type = attrsOf str;
1037 description = "Mapping 'name'.php => script for webhooks";
1038 };
1039 csp_reports = mkOption {
1040 description = "CSP report configuration";
1041 type = submodule {
1042 options = {
1043 report_uri = mkOption { type = str; description = "URI to report CSP violations to"; };
1044 policies = mkOption { type = attrsOf str; description = "CSP policies to apply"; };
1045 };
1046 };
1047 };
1048 commento = mkOption {
1049 description = "Commento configuration";
1050 type = submodule {
1051 options = {
1052 listenPort = mkOption { type = port; description = "Port to listen to"; };
1053 postgresql = mkPsqlOptions "Commento";
1054 smtp = mkSmtpOptions "Commento";
1055 };
1056 };
1057 };
1058 cryptpad = mkOption {
1059 description = "Cryptpad configuration";
1060 type = submodule {
1061 options = {
1062 email = mkOption { type = str; description = "Admin e-mail"; };
1063 admins = mkOption { type = listOf str; description = "Instance admin public keys"; };
1064 port = mkOption { type = port; description = "Port to listen to"; };
1065 };
1066 };
1067 };
1068 ympd = mkOption {
1069 description = "Ympd configuration";
1070 type = submodule {
1071 options = {
1072 listenPort = mkOption { type = port; description = "Port to listen to"; };
1073 mpd = mkOption {
1074 description = "MPD configuration";
1075 type = submodule {
1076 options = {
1077 password = mkOption { type = str; description = "Password to access MPD host"; };
1078 host = mkOption { type = str; description = "Host for MPD"; };
1079 port = mkOption { type = port; description = "Port to access MPD host"; };
1080 };
1081 };
1082 };
1083 };
1084 };
1085 };
1086 umami = mkOption {
1087 description = "Umami configuration";
1088 type = submodule {
1089 options = {
1090 listenPort = mkOption { type = port; description = "Port to listen to"; };
1091 postgresql = mkPsqlOptions "Umami";
1092 hashSalt = mkOption { type = str; description = "Hash salt"; };
1093 };
1094 };
1095 };
1096 yourls = mkOption {
1097 description = "Yourls configuration";
1098 type = submodule {
1099 options = {
1100 mysql = mkMysqlOptions "Yourls" {};
1101 ldap = mkLdapOptions "Yourls" {};
1102 cookieKey = mkOption { type = str; description = "Cookie key"; };
1103 };
1104 };
1105 };
1106 };
1107 };
1108 };
1a64deeb
IB
1109 };
1110 options.hostEnv = mkOption {
1111 readOnly = true;
1112 type = hostEnv;
1113 default = config.myEnv.servers."${name}";
1114 description = "Host environment";
1115 };
1116 };
1117 };
1118}