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>
23 enable = lib.mkEnableOption "friot";
24 networking.domainBase = lib.mkOption {
26 description = "Base network name.";
29 networking.domainAliases = lib.mkOption {
30 type = types.listOf types.str;
31 description = "Domain aliases.";
32 example = [ "example.org" "example.net" ];
34 networking.zones = lib.mkOption {
35 type = types.attrsOf (types.submodule ({name, options, config, ...}: {
37 iface = lib.mkOption {
39 description = "Interface name.";
44 description = "Static IPv4 address of the machine.";
49 description = "Static IPv6 address of the machine.";
57 nixpkgs.overlays = import ../overlays.nix;
59 domainBase = "commonsoft";
60 domain = "${networking.domainBase}.coop";
62 "${networking.domainBase}.org"
63 "${networking.domainBase}.net"
66 users.mutableUsers = false;
68 root.initialPassword = userPass "root";
69 root.password = config.users.users.root.initialPassword;
72 extraGroups = [ "sudo" ];
73 description = "Julien Moutinho";
75 shell = lib.mkDefault config.users.defaultUserShell;
76 group = "julm"; # FIXME: unknown group
77 initialPassword = userPass "julm";
78 password = config.users.users.julm.initialPassword;
83 gid = config.users.users.julm.uid;
89 enable = false; # NOTE: useless on this machine, and CPU intensive.
114 (dom: map (sub: "${sub}.${dom}")
115 ["www" "git" "mail"])
116 ([networking.domain] ++ networking.domainAliases)
117 ++ networking.domainAliases;
120 # "root@${networking.domain}" = [ "test@${networking.domain}" ];
121 # "postmaster@${networking.domain}" = [ "test@${networking.domain}" ];
122 # "abuse@${networking.domain}" = [ "test@${networking.domain}" ];
124 #dovecot2.domains = {
125 # "${networking.domain}" = {
128 # password = pass "${networking.domain}/mail/julm";
129 # # "${networking.domain}/dovecot2/julm";
130 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
131 # aliases = ["julien.moutinho@${networking.domain}"];
135 # password = pass "${networking.domain}/mail/test";
136 # # "${networking.domain}/dovecot2/test";
137 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
138 # aliases = ["test-alias@${networking.domain}"];
146 systemPackages = with pkgs; [