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>
22 enable = lib.mkEnableOption "friot";
23 networking.domainBase = lib.mkOption {
25 description = "Base network name.";
28 networking.domainAliases = lib.mkOption {
29 type = types.listOf types.str;
30 description = "Domain aliases.";
31 example = [ "example.org" "example.net" ];
33 networking.zones = lib.mkOption {
34 type = types.attrsOf (types.submodule ({name, options, config, ...}: {
36 iface = lib.mkOption {
38 description = "Interface name.";
43 description = "Static IPv4 address of the machine.";
48 description = "Static IPv6 address of the machine.";
56 nixpkgs.overlays = import ../overlays.nix;
58 domainBase = "commonsoft";
59 domain = "${networking.domainBase}.coop";
61 "${networking.domainBase}.org"
62 "${networking.domainBase}.net"
65 users.mutableUsers = false;
67 root.initialPassword = userPass "root";
68 root.password = config.users.users.root.initialPassword;
71 extraGroups = [ "sudo" ];
72 description = "Julien Moutinho";
74 shell = lib.mkDefault config.users.defaultUserShell;
75 group = "julm"; # FIXME: unknown group
76 initialPassword = userPass "julm";
77 password = config.users.users.julm.initialPassword;
82 gid = config.users.users.julm.uid;
88 enable = false; # NOTE: useless on this machine, and CPU intensive.
113 (dom: map (sub: "${sub}.${dom}")
114 ["www" "git" "mail"])
115 ([networking.domain] ++ networking.domainAliases)
116 ++ networking.domainAliases;
119 # "root@${networking.domain}" = [ "test@${networking.domain}" ];
120 # "postmaster@${networking.domain}" = [ "test@${networking.domain}" ];
121 # "abuse@${networking.domain}" = [ "test@${networking.domain}" ];
123 #dovecot2.domains = {
124 # "${networking.domain}" = {
127 # password = pass "${networking.domain}/mail/julm";
128 # # "${networking.domain}/dovecot2/julm";
129 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
130 # aliases = ["julien.moutinho@${networking.domain}"];
134 # password = pass "${networking.domain}/mail/test";
135 # # "${networking.domain}/dovecot2/test";
136 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
137 # aliases = ["test-alias@${networking.domain}"];
145 systemPackages = with pkgs; [