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