]> Git — Sourcephile - sourcephile-nix.git/blob - nixos/defaults.nix
mermet: move rpool/nix/var to rpool/nix
[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 autoOptimiseStore = true;
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 };
21
22 nixpkgs = {
23 config = {
24 allowUnfree = false;
25 /*
26 packageOverrides = pkgs: {
27 postfix = pkgs.postfix.override {
28 withLDAP = true;
29 };
30 };
31 */
32 };
33 #overlays = import ../overlays.nix;
34 };
35
36 documentation.nixos = {
37 enable = false; # NOTE: useless on this machine, and CPU intensive.
38 };
39
40 time = {
41 timeZone = "Europe/Paris";
42 };
43
44 i18n = {
45 consoleFont = "Lat2-Terminus16";
46 consoleKeyMap = "fr";
47 defaultLocale = "fr_FR.UTF-8";
48 };
49
50 services = {
51 openssh = {
52 enable = true;
53 extraConfig = ''
54 '';
55 };
56 journald = {
57 extraConfig = ''
58 SystemMaxUse=50M
59 '';
60 };
61 };
62
63 environment = {
64 systemPackages = with pkgs; [
65 binutils
66 dnsutils
67 htop
68 inetutils
69 iotop
70 lsof
71 mailutils
72 multitail
73 ncdu
74 pv
75 swaplist
76 tcpdump
77 tmux
78 tree
79 vim
80 which
81 ];
82
83 etc."inputrc".text = lib.readFile defaults/readline/inputrc;
84 };
85
86 programs = {
87 bash = {
88 interactiveShellInit = ''
89 bind '"\e[A":history-search-backward'
90 bind '"\e[B":history-search-forward'
91
92 # Ignore duplicate commands, ignore commands starting with a space
93 export HISTCONTROL=erasedups:ignorespace
94 export HISTSIZE=42000
95
96 # Append to the history instead of overwriting (good for multiple connections)
97 shopt -s histappend
98 '';
99 shellAliases = {
100 cl = "clear";
101 l = "ls -alh";
102 ll = "ls -l";
103 ls = "ls --color=tty";
104 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
105
106 s="sudo systemctl";
107 s-u="systemctl --user";
108
109 nixos-clean="sudo nix-collect-garbage -d";
110 nixos-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
111 nixos-rollback="sudo nixos-rebuild switch --rollback";
112 nixos-update="sudo nix-channel --update";
113 nixos-upgrade="sudo nixos-rebuild switch";
114 nixos-upstream="sudo nix-channel --list";
115 };
116 };
117 mtr.enable = true;
118 };
119 };
120 }