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-sourcephile/install/modules.nix>
11 ../overlays/tools/networking/shorewall/service.nix
12 ../overlays/tools/networking/shorewall6/service.nix
13 ../overlays/servers/mail/rspamd/service.nix
31 auto-optimise-store = true
36 options = "--delete-older-than 30d";
43 packageOverrides = pkgs: {
44 postfix = pkgs.postfix.override {
49 overlays = import ../overlays.nix;
55 enable = config.deployment.targetEnv != "virtualbox";
58 authorizedKeys = [ (pass "${networking.domain}/ssh/pub/julm") ];
65 "vm.vfs_cache_pressure" = 50;
71 timeZone = "Europe/Paris";
75 consoleFont = "Lat2-Terminus16";
77 defaultLocale = "fr_FR.UTF-8";
81 domainBase = "sourcephile";
82 domain = "${networking.domainBase}.fr";
84 #"${networking.domainBase}.coop"
91 root.initialPassword = userPass "root";
92 root.password = config.users.users.root.initialPassword;
95 extraGroups = [ "sudo" ];
96 description = "Julien Moutinho";
98 shell = lib.mkDefault config.users.defaultUserShell;
99 group = "users"; # FIXME: unknown group
100 initialPassword = userPass "julm";
101 password = config.users.users.julm.initialPassword;
106 gid = config.users.users.julm.uid;
111 documentation.nixos = {
112 enable = false; # NOTE: useless on this machine, and CPU intensive.
144 (dom: map (sub: "${sub}.${dom}")
145 ["www" "git" "mail"])
146 ([networking.domain] ++ networking.domainAliases)
147 ++ networking.domainAliases;
150 # "root@${networking.domain}" = [ "test@${networking.domain}" ];
151 # "postmaster@${networking.domain}" = [ "test@${networking.domain}" ];
152 # "abuse@${networking.domain}" = [ "test@${networking.domain}" ];
154 #dovecot2.domains = {
155 # "${networking.domain}" = {
158 # password = pass "${networking.domain}/mail/julm";
159 # # "${networking.domain}/dovecot2/julm";
160 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
161 # aliases = ["julien.moutinho@${networking.domain}"];
165 # password = pass "${networking.domain}/mail/test";
166 # # "${networking.domain}/dovecot2/test";
167 # # "{SSHA512}uyjL1KYx4z7HpfNvnKzuVxpMLD2KVueGGBvOcj7AF1EZCTVhT++IIKUVOC4xpZtWdqVD0OVmZqgYr2qpn/3t3Aj4oU0=";
168 # aliases = ["test-alias@${networking.domain}"];
177 systemPackages = with pkgs; [
211 etc."inputrc".text = ''
212 # /etc/inputrc - global inputrc for libreadline
213 # See readline(3readline) and `info rluserman' for more information.
219 # To allow the use of 8bit-characters like the german umlauts, uncomment
220 # the line below. However this makes the meta key not work as a meta key,
221 # which is annoying to those which don't need to type in 8-bit characters.
223 # set convert-meta off
225 # try to enable the application keypad when it is called. Some systems
226 # need this to enable the arrow keys.
227 # set enable-keypad on
229 # see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
231 # do not bell on tab-completion
232 # set bell-style none
233 # set bell-style visible
235 # some defaults / modifications for the emacs mode
238 # allow the use of the Home/End keys
239 "\e[1~": beginning-of-line
242 # allow the use of the Delete/Insert keys
244 "\e[2~": quoted-insert
246 # mappings for "page up" and "page down" to step to the beginning/end
248 # "\e[5~": beginning-of-history
249 # "\e[6~": end-of-history
251 # alternate mappings for "page up" and "page down" to search the history
252 # "\e[5~": history-search-backward
253 # "\e[6~": history-search-forward
255 # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
256 "\e[1;5C": forward-word
257 "\e[1;5D": backward-word
258 "\e[5C": forward-word
259 "\e[5D": backward-word
260 "\e\e[C": forward-word
261 "\e\e[D": backward-word
264 "\e[7~": beginning-of-line
267 "\eOd": backward-word
270 # for non RH/Debian xterm, can't hurt for RH/Debian xterm
271 # "\eOH": beginning-of-line
272 # "\eOF": end-of-line
274 # for freebsd console
275 # "\e[H": beginning-of-line
276 # "\e[F": end-of-line
284 interactiveShellInit = ''
285 bind '"\e[A":history-search-backward'
286 bind '"\e[B":history-search-forward'
288 # Ignore duplicate commands, ignore commands starting with a space
289 export HISTCONTROL=erasedups:ignorespace
290 export HISTSIZE=42000
291 # Append to the history instead of overwriting (good for multiple connections)
298 ls = "ls --color=tty";
301 s-u="systemctl --user";
303 nix-clean="sudo nix-collect-garbage -d";
304 nix-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
305 nix-rollback="sudo nixos-rebuild switch --rollback";
306 nix-update="sudo nix-channel --update";
307 nix-upgrade="sudo nixos-rebuild switch";
308 nix-upstream="sudo nix-channel --list";
309 nix-config="gvim ~/.config/nixos/*.nix";
318 enableSSHSupport = true;