]> Git — Sourcephile - sourcephile-nix.git/blob - nixos/defaults.nix
gitweb: add disallows to robots.txt
[sourcephile-nix.git] / nixos / defaults.nix
1 { pkgs, lib, config, ... }:
2 let inherit (lib) types;
3 in
4 {
5 imports = [
6 ./modules.nix
7 ./defaults/predictable-interface-names.nix
8 ];
9 config = {
10 nix = {
11 #binaryCaches = lib.mkForce [];
12 extraOptions = ''
13 '';
14 # Use gc.automatic to keep disk space under control.
15 gc = {
16 automatic = true;
17 dates = "weekly";
18 options = "--delete-older-than 30d";
19 };
20 nixPath = [
21 ("nixpkgs=" + toString pkgs.path)
22 ];
23 };
24
25 nixpkgs = {
26 config = {
27 allowUnfree = false;
28 /*
29 packageOverrides = pkgs: {
30 postfix = pkgs.postfix.override {
31 withLDAP = true;
32 };
33 };
34 */
35 };
36 #overlays = import ../overlays.nix;
37 };
38
39 documentation.nixos = {
40 enable = false; # NOTE: useless on a server, and CPU intensive.
41 };
42
43 # Clean /tmp automatically on boot.
44 boot.cleanTmpDir = true;
45
46 time = {
47 timeZone = "Europe/Paris";
48 };
49
50 i18n = {
51 defaultLocale = "fr_FR.UTF-8";
52 };
53
54 console = {
55 font = "Lat2-Terminus16";
56 keyMap = "fr";
57 };
58
59 services = {
60 openssh = {
61 enable = true;
62 passwordAuthentication = false;
63 extraConfig = ''
64 '';
65 };
66 journald = {
67 extraConfig = ''
68 SystemMaxUse=50M
69 '';
70 };
71 };
72
73 environment = {
74 #checkConfigurationOptions = false;
75 systemPackages = with pkgs; [
76 binutils
77 #dnsutils
78 dstat
79 htop
80 inetutils
81 iotop
82 lsof
83 mailutils
84 multitail
85 ncdu
86 pv
87 swaplist
88 tcpdump
89 tmux
90 tree
91 vim
92 which
93 ];
94
95 etc."inputrc".text = lib.readFile defaults/readline/inputrc;
96 };
97
98 programs = {
99 bash = {
100 interactiveShellInit = ''
101 bind '"\e[A":history-search-backward'
102 bind '"\e[B":history-search-forward'
103
104 # Ignore duplicate commands, ignore commands starting with a space
105 export HISTCONTROL=erasedups:ignorespace
106 export HISTSIZE=42000
107
108 # Append to the history instead of overwriting (good for multiple connections)
109 shopt -s histappend
110 '';
111 shellAliases = {
112 cl = "clear";
113 l = "ls -alh";
114 ll = "ls -l";
115 ls = "ls --color=tty";
116 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
117
118 s="sudo systemctl";
119 s-u="systemctl --user";
120
121 nixos-clean="sudo nix-collect-garbage -d";
122 nixos-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
123 nixos-rollback="sudo nixos-rebuild switch --rollback";
124 nixos-update="sudo nix-channel --update";
125 nixos-upgrade="sudo nixos-rebuild switch";
126 nixos-upstream="sudo nix-channel --list";
127 };
128 };
129 gnupg = {
130 agent = {
131 pinentryFlavor = "curses";
132 };
133 };
134 mtr.enable = true;
135 };
136 };
137 }