]> Git — Sourcephile - sourcephile-nix.git/blob - nixos/defaults.nix
nix: add mem and swaplist
[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 mailutils
71 multitail
72 ncdu
73 pv
74 swaplist
75 tcpdump
76 tmux
77 tree
78 vim
79 which
80 ];
81
82 etc."inputrc".text = lib.readFile defaults/readline/inputrc;
83 };
84
85 programs = {
86 bash = {
87 interactiveShellInit = ''
88 bind '"\e[A":history-search-backward'
89 bind '"\e[B":history-search-forward'
90
91 # Ignore duplicate commands, ignore commands starting with a space
92 export HISTCONTROL=erasedups:ignorespace
93 export HISTSIZE=42000
94
95 # Append to the history instead of overwriting (good for multiple connections)
96 shopt -s histappend
97 '';
98 shellAliases = {
99 cl = "clear";
100 l = "ls -alh";
101 ll = "ls -l";
102 ls = "ls --color=tty";
103 mem = "ps -e -orss=,user=,args= | sort -b -k1,1n";
104
105 s="sudo systemctl";
106 s-u="systemctl --user";
107
108 nixos-clean="sudo nix-collect-garbage -d";
109 nixos-history="sudo nix-env --list-generations --profile /nix/var/nix/profiles/system";
110 nixos-rollback="sudo nixos-rebuild switch --rollback";
111 nixos-update="sudo nix-channel --update";
112 nixos-upgrade="sudo nixos-rebuild switch";
113 nixos-upstream="sudo nix-channel --list";
114 };
115 };
116 mtr.enable = true;
117 };
118 };
119 }