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}/pass";
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 = config.deployment.targetEnv != "virtualbox";
93 authorizedKeys = [ (pass "${networking.domain}/${networking.hostName}/julm/ssh.pub") ];
100 enable = false; # NOTE: useless on this machine, and CPU intensive.
130 (dom: map (sub: "${sub}.${dom}")
131 ["www" "git" "mail"])
132 ([networking.domain] ++ networking.domainAliases)
133 ++ networking.domainAliases;
136 # "root@${networking.domain}" = [ "test@${networking.domain}" ];
137 # "postmaster@${networking.domain}" = [ "test@${networking.domain}" ];
138 # "abuse@${networking.domain}" = [ "test@${networking.domain}" ];
140 #dovecot2.domains = {
141 # "${networking.domain}" = {
144 # password = pass "${networking.domain}/mail/julm";
145 # # "${networking.domain}/dovecot2/julm";
146 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
147 # aliases = ["julien.moutinho@${networking.domain}"];
151 # password = pass "${networking.domain}/mail/test";
152 # # "${networking.domain}/dovecot2/test";
153 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
154 # aliases = ["test-alias@${networking.domain}"];
162 systemPackages = with pkgs; [
195 etc."inputrc".text = ''
196 # /etc/inputrc - global inputrc for libreadline
197 # See readline(3readline) and `info rluserman' for more information.
203 # To allow the use of 8bit-characters like the german umlauts, uncomment
204 # the line below. However this makes the meta key not work as a meta key,
205 # which is annoying to those which don't need to type in 8-bit characters.
207 # set convert-meta off
209 # try to enable the application keypad when it is called. Some systems
210 # need this to enable the arrow keys.
211 # set enable-keypad on
213 # see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
215 # do not bell on tab-completion
216 # set bell-style none
217 # set bell-style visible
219 # some defaults / modifications for the emacs mode
222 # allow the use of the Home/End keys
223 "\e[1~": beginning-of-line
226 # allow the use of the Delete/Insert keys
228 "\e[2~": quoted-insert
230 # mappings for "page up" and "page down" to step to the beginning/end
232 # "\e[5~": beginning-of-history
233 # "\e[6~": end-of-history
235 # alternate mappings for "page up" and "page down" to search the history
236 # "\e[5~": history-search-backward
237 # "\e[6~": history-search-forward
239 # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
240 "\e[1;5C": forward-word
241 "\e[1;5D": backward-word
242 "\e[5C": forward-word
243 "\e[5D": backward-word
244 "\e\e[C": forward-word
245 "\e\e[D": backward-word
248 "\e[7~": beginning-of-line
251 "\eOd": backward-word
254 # for non RH/Debian xterm, can't hurt for RH/Debian xterm
255 # "\eOH": beginning-of-line
256 # "\eOF": end-of-line
258 # for freebsd console
259 # "\e[H": beginning-of-line
260 # "\e[F": end-of-line