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