summary refs log tree commit diff
path: root/modules/base.nix
blob: 2666af32c558de47d4b97eec19bdee04979eb05b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{ config, pkgs, lib, ... }:

{
  imports =
    [
      ./packages/vim.nix
      ./users/Rory.nix
      ./extra-substituters.nix
    ];

  boot = {
    kernelParams = [ 
      "memory_hotplug.memmap_on_memory=1"
      "memhp_default_state=online"
      "net.core.default_qdisc=fq"
      "net.ipv4.tcp_congestion_control=bbr"
      "mitigations=off"
      "audit=0"
      "consoleblank=0"
      "kmemcheck=0"
      "no_console_suspend"
      "kernel.core_pattern=/dev/null"
      "init_on_alloc=0"
      "kernel.sysrq=1"
      "kernel.dmesg_restrict=0"
      "net.ipv4.ip_forward=1"
      "vm.swappiness=10"
      "net.core.netdev_max_backlog=16384"
      "net.core.somaxconn=8192"
      "net.core.rmem_default=1048576"
      "net.core.rmem_max=16777216"
      "net.core.wmem_default=1048576"
      "net.core.wmem_max=16777216"
      "net.core.optmem_max=65536"
      #"net.ipv4.tcp_rmem=4096 1048576 2097152"
      #"net.ipv4.tcp_wmem=4096 65536 16777216"
      "net.ipv4.udp_rmem_min=4096"
      "net.ipv4.udp_wmem_min=4096"
      "net.ipv4.tcp_fastopen=3"
      "net.ipv4.tcp_mtu_probing=1"
      "net.ipv4.tcp_keepalive_time=30"
      "net.ipv4.tcp_keepalive_intvl=15"
      "net.ipv4.tcp_keepalive_probes=4"
      "net.ipv4.tcp_timestamps=0"
    ];
  };

  networking = {
    hostName = lib.mkDefault "Rory-nix-base";
    firewall = {
      enable = false;
      # allowedTCPPorts = [ ... ];
      # allowedUDPPorts = [ ... ];
    };
    nameservers =  [ "1.1.1.1" "1.0.0.1" "8.8.8.8" "8.4.4.8" ];
  };

  i18n.defaultLocale = "en_US.UTF-8";

  services = {
    openssh = {
      enable = true;
      #allow more logins in cases where i have many ssh keys on a system
      extraConfig = ''
        MaxAuthTries 32
        '';
    };	
  };

  systemd = {
    sleep.extraConfig = ''
      AllowSuspend=no
      AllowHibernation=no
      '';
  };

  environment.systemPackages = with pkgs; [
    wget
    neofetch
    lnav
    pciutils
    git
    lsd
    duf
    htop
    btop
    duf
    kitty.terminfo
    tmux
    jq
    yq
    pv
    dig
    cloud-utils
    nix-output-monitor
    expect
    unrar-wrapper

    # - zsh
    zsh
    zsh-powerlevel10k
    zsh-nix-shell
    zsh-you-should-use
    zsh-syntax-highlighting
    zsh-completions
  ];

  systemd.coredump.extraConfig = lib.mkDefault ''
    Storage=none
  '';
  nix = {
    settings = {
      experimental-features = [ "nix-command" "flakes" ];
      auto-optimise-store = true;
    };
  };
  nixpkgs = {
    config.allowUnfree = true;
  };
  security = {
    polkit.enable = true;
    sudo.wheelNeedsPassword = false;
  };

}