1 {pkgs, lib, config, system, ...}:
2 let inherit (builtins.extraBuiltins) pass;
4 inherit (config) networking;
5 inherit (config.services) dovecot2;
6 userPass = name: pass ("${networking.domain}/${networking.hostName}/"+name);
9 <nixpkgs-commonsoft/install/modules.nix>
24 enable = lib.mkEnableOption "friot";
25 networking.domainBase = lib.mkOption {
27 description = "Base network name.";
30 networking.domainAliases = lib.mkOption {
31 type = types.listOf types.str;
32 description = "Domain aliases.";
33 example = [ "example.org" "example.net" ];
35 networking.zones = lib.mkOption {
36 type = types.attrsOf (types.submodule ({name, options, config, ...}: {
38 iface = lib.mkOption {
40 description = "Interface name.";
45 description = "Static IPv4 address of the machine.";
50 description = "Static IPv6 address of the machine.";
58 nixpkgs.overlays = import ../overlays.nix;
60 domainBase = "commonsoft";
61 domain = "${networking.domainBase}.coop";
63 "${networking.domainBase}.org"
64 "${networking.domainBase}.net"
67 users.mutableUsers = false;
69 root.initialPassword = userPass "root";
70 root.password = config.users.users.root.initialPassword;
73 extraGroups = [ "sudo" ];
74 description = "Julien Moutinho";
76 shell = lib.mkDefault config.users.defaultUserShell;
77 group = "julm"; # FIXME: unknown group
78 initialPassword = userPass "julm";
79 password = config.users.users.julm.initialPassword;
84 gid = config.users.users.julm.uid;
90 enable = false; # NOTE: useless on this machine, and CPU intensive.
115 (dom: map (sub: "${sub}.${dom}")
116 ["www" "git" "mail"])
117 ([networking.domain] ++ networking.domainAliases)
118 ++ networking.domainAliases;
121 # "root@${networking.domain}" = [ "test@${networking.domain}" ];
122 # "postmaster@${networking.domain}" = [ "test@${networking.domain}" ];
123 # "abuse@${networking.domain}" = [ "test@${networking.domain}" ];
125 #dovecot2.domains = {
126 # "${networking.domain}" = {
129 # password = pass "${networking.domain}/mail/julm";
130 # # "${networking.domain}/dovecot2/julm";
131 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
132 # aliases = ["julien.moutinho@${networking.domain}"];
136 # password = pass "${networking.domain}/mail/test";
137 # # "${networking.domain}/dovecot2/test";
138 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
139 # aliases = ["test-alias@${networking.domain}"];
147 systemPackages = with pkgs; [