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