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.domainBase}/${networking.hostName}/login/${name}";
 
   9   <nixpkgs-commonsoft/install/modules.nix>
 
  10   ../overlays/tools/networking/shorewall/service.nix
 
  11   ../overlays/tools/networking/shorewall6/service.nix
 
  26   enable = lib.mkEnableOption "friot";
 
  27   networking.domainBase = lib.mkOption {
 
  29     description = "Base network name.";
 
  32   networking.domainAliases = lib.mkOption {
 
  33     type        = types.listOf types.str;
 
  34     description = "Domain aliases.";
 
  35     example     = [ "example.org" "example.net" ];
 
  37   networking.zones = lib.mkOption {
 
  38     type = types.attrsOf (types.submodule ({name, options, config, ...}: {
 
  40         iface = lib.mkOption {
 
  42           description = "Interface name.";
 
  47           description = "Static IPv4 address of the machine.";
 
  52           description = "Static IPv6 address of the machine.";
 
  60   nixpkgs.overlays = import ../overlays.nix;
 
  62     domainBase    = "commonsoft";
 
  63     domain        = "${networking.domainBase}.org";
 
  65      "${networking.domainBase}.net"
 
  66      "${networking.domainBase}.coop"
 
  69   users.mutableUsers = false;
 
  71       root.initialPassword = userPass "root";
 
  72       root.password        = config.users.users.root.initialPassword;
 
  75         extraGroups     = [ "sudo" ];
 
  76         description     = "Julien Moutinho";
 
  78         shell           = lib.mkDefault config.users.defaultUserShell;
 
  79         group           = "julm"; # FIXME: unknown group
 
  80         initialPassword = userPass "julm";
 
  81         password        = config.users.users.julm.initialPassword;
 
  86       gid = config.users.users.julm.uid;
 
  92       enable = config.deployment.targetEnv != "virtualbox";
 
  95         authorizedKeys = [ (pass "${networking.domain}/ssh/pub/julm") ];
 
 102       enable = false; # NOTE: useless on this machine, and CPU intensive.
 
 132          (dom: map (sub: "${sub}.${dom}")
 
 133            ["www" "git" "mail"])
 
 134          ([networking.domain] ++ networking.domainAliases)
 
 135         ++ networking.domainAliases;
 
 138     #        "root@${networking.domain}" = [ "test@${networking.domain}" ];
 
 139     #  "postmaster@${networking.domain}" = [ "test@${networking.domain}" ];
 
 140     #       "abuse@${networking.domain}" = [ "test@${networking.domain}" ];
 
 142     #dovecot2.domains = {
 
 143     #  "${networking.domain}" = {
 
 146     #        password = pass "${networking.domain}/mail/julm";
 
 147     #         # "${networking.domain}/dovecot2/julm";
 
 148     #           #  "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
 
 149     #        aliases  = ["julien.moutinho@${networking.domain}"];
 
 153     #        password = pass "${networking.domain}/mail/test";
 
 154     #         # "${networking.domain}/dovecot2/test";
 
 155     #           #  "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
 
 156     #        aliases  = ["test-alias@${networking.domain}"];
 
 164     systemPackages = with pkgs; [
 
 197     etc."inputrc".text = ''
 
 198       # /etc/inputrc - global inputrc for libreadline
 
 199       # See readline(3readline) and `info rluserman' for more information.
 
 205       # To allow the use of 8bit-characters like the german umlauts, uncomment
 
 206       # the line below. However this makes the meta key not work as a meta key,
 
 207       # which is annoying to those which don't need to type in 8-bit characters.
 
 209       # set convert-meta off
 
 211       # try to enable the application keypad when it is called.  Some systems
 
 212       # need this to enable the arrow keys.
 
 213       # set enable-keypad on
 
 215       # see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
 
 217       # do not bell on tab-completion
 
 218       # set bell-style none
 
 219       # set bell-style visible
 
 221       # some defaults / modifications for the emacs mode
 
 224       # allow the use of the Home/End keys
 
 225       "\e[1~": beginning-of-line
 
 228       # allow the use of the Delete/Insert keys
 
 230       "\e[2~": quoted-insert
 
 232       # mappings for "page up" and "page down" to step to the beginning/end
 
 234       # "\e[5~": beginning-of-history
 
 235       # "\e[6~": end-of-history
 
 237       # alternate mappings for "page up" and "page down" to search the history
 
 238       # "\e[5~": history-search-backward
 
 239       # "\e[6~": history-search-forward
 
 241       # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
 
 242       "\e[1;5C": forward-word
 
 243       "\e[1;5D": backward-word
 
 244       "\e[5C": forward-word
 
 245       "\e[5D": backward-word
 
 246       "\e\e[C": forward-word
 
 247       "\e\e[D": backward-word
 
 250       "\e[7~": beginning-of-line
 
 253       "\eOd": backward-word
 
 256       # for non RH/Debian xterm, can't hurt for RH/Debian xterm
 
 257       # "\eOH": beginning-of-line
 
 258       # "\eOF": end-of-line
 
 260       # for freebsd console
 
 261       # "\e[H": beginning-of-line
 
 262       # "\e[F": end-of-line