]> Git — Sourcephile - sourcephile-nix.git/blob - install/mermet/logical/system.nix
nixops: add mermet
[sourcephile-nix.git] / install / mermet / logical / system.nix
1 { pkgs, lib, config, ... }:
2 {
3 nix = {
4 autoOptimiseStore = true;
5 extraOptions = ''
6 '';
7 # Use gc.automatic to keep disk space under control.
8 gc = {
9 automatic = true;
10 dates = "weekly";
11 options = "--delete-older-than 30d";
12 };
13 };
14
15 nixpkgs = {
16 config = {
17 allowUnfree = false;
18 /*
19 packageOverrides = pkgs: {
20 postfix = pkgs.postfix.override {
21 withLDAP = true;
22 };
23 };
24 */
25 };
26 #overlays = import ../overlays.nix;
27 };
28 users = {
29 mutableUsers = false;
30 users = {
31 root = {
32 initialPassword = "toor";
33 password = "toor";
34 openssh.authorizedKeys.keys = [
35 # julm
36 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD5FtR++UPEg/5wFeyb2JSS09idTaDb4tMIRf1yxCsyIJEp5LQMif/fIptDeHoYc55lwy8vnWWN9PJpb6PS8YSaLLFV5tn8esR8Ml+evNCAD52Tdu1kPRXGLCSF5kSVnbAMoxqiNi8vRRKXwAzGgXmIUzDAE4QTsq3EwZM6cBnDx5O79wBIZ9va2TObL52qv+Vpi+QyINuslKKc+Osu92pdwceIGZUcwA6Y8aH6lavaTyDUQdSjMRMTAiXSPRjmHf1q+V7wENXT/TKXuuahN8NnJShX3Qf9hwNEIU46SOENsrRFQ5eYahAmqUIK4GbsERS2KRDxbvSOl7rKh2sauBxyKfkW/gxQ4LAyywxuumpI0pO7XmdINCGWdXS9gD216lcGuH/TC0KboiOVExh65eRIOeEFTec0VJQEqqnFul7u8YNPmbBpLnM+SQ3TAkdQmfasKgPIazFNCAnC8I9hKlGYpLk/Dgi/sVbwFeoOUQcaTBRnWKUCedX4v4kmPIHuHSNPV2C/0770gH2iJ1N1XEO3YDGiixuHHiLlCV8Ko950CoTh1PwDNCd3Qy/jR/QhE2waVPliFwl2+H6IkIxkUO8A9ktLCJUeaZJN3snoV+9hvpT1E2TrEccsTVx5BaGAJCUkvO2XYlEsNceIIitkrbhidjZvfZ4/czGUKoN1wSSpMw== GnuPG pub=F2E027182397AC0775714F2AD15AF7F467E8299B sub=7819E44BAEEDE91683811BB00E1AAADBE227DDAA"
37 ];
38 };
39 };
40 groups = {
41 };
42 };
43
44 documentation.nixos = {
45 enable = false; # NOTE: useless on this machine, and CPU intensive.
46 };
47
48 time = {
49 timeZone = "Europe/Paris";
50 };
51
52 i18n = {
53 consoleFont = "Lat2-Terminus16";
54 consoleKeyMap = "fr";
55 defaultLocale = "fr_FR.UTF-8";
56 };
57
58 services = {
59 openssh = {
60 enable = true;
61 extraConfig = ''
62 '';
63 };
64 journald = {
65 extraConfig = ''
66 SystemMaxUse=50M
67 '';
68 };
69 };
70
71 environment = {
72 systemPackages = with pkgs; [
73 htop
74 tree
75 vim
76 tcpdump
77 cryptsetup
78 multitail
79 dnsutils
80 inetutils
81 binutils
82 mailutils
83 ncdu
84 tmux
85 socat
86 which
87 zfs
88 ];
89
90 etc."inputrc".text = lib.readFile etc/inputrc;
91 };
92
93 programs = {
94 bash = {
95 interactiveShellInit = ''
96 bind '"\e[A":history-search-backward'
97 bind '"\e[B":history-search-forward'
98
99 # Ignore duplicate commands, ignore commands starting with a space
100 export HISTCONTROL=erasedups:ignorespace
101 export HISTSIZE=42000
102 # Append to the history instead of overwriting (good for multiple connections)
103 shopt -s histappend
104 '';
105 shellAliases = {
106 cl = "clear";
107 l = "ls -alh";
108 ll = "ls -l";
109 ls = "ls --color=tty";
110
111 s="sudo systemctl";
112 s-u="systemctl --user";
113
114 nixos-clean="sudo nix-collect-garbage -d";
115 nixos-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
116 nixos-rollback="sudo nixos-rebuild switch --rollback";
117 nixos-update="sudo nix-channel --update";
118 nixos-upgrade="sudo nixos-rebuild switch";
119 nixos-upstream="sudo nix-channel --list";
120 };
121 };
122 mtr.enable = true;
123 };
124
125 # This value determines the NixOS release with which your system is to be
126 # compatible, in order to avoid breaking some software such as database
127 # servers. You should change this only after NixOS release notes say you
128 # should.
129 system.stateVersion = "19.09"; # Did you read the comment?
130 }