diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-09-12 13:11:20 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-09-12 13:55:09 -0700 |
| commit | 2fea36c19eb904125e2db5ba230b28d72dc881db (patch) | |
| tree | 4233e16f0d50aec1cd5e4d3e5f5ed1b8728e380c /modules/nixos/base.nix | |
| parent | move common modules together and simplify imports (diff) | |
| download | infra-2fea36c19eb904125e2db5ba230b28d72dc881db.tar.gz | |
start to refactor nixos modules
Diffstat (limited to 'modules/nixos/base.nix')
| -rw-r--r-- | modules/nixos/base.nix | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/modules/nixos/base.nix b/modules/nixos/base.nix new file mode 100644 index 0000000..f3dece1 --- /dev/null +++ b/modules/nixos/base.nix @@ -0,0 +1,65 @@ +{ + self, + config, + pkgs, + lib, + ... +}: +{ + boot = { + kernelPackages = pkgs.linuxPackages_latest; + kernel.sysctl = { + "net.ipv4.tcp_congestion_control" = "bbr"; + "net.ipv4.tcp_ecn" = 1; + "net.ipv4.tcp_fastopen" = 3; + "net.ipv4.tcp_tw_reuse" = 1; + }; + }; + + i18n = { + defaultLocale = "en_US.UTF-8"; + supportedLocales = [ + "en_US.UTF-8/UTF-8" + ]; + }; + + time.timeZone = "America/Los_Angeles"; + + users.motdFile = "/etc/motd"; + + environment.etc.motd.text = '' + Machine ${config.networking.hostName} + NixOS ${config.system.nixos.release} + @ ${self.shortRev or self.dirtyShortRev} + ''; + + ## disable that slow "building man-cache" step + documentation.man.generateCaches = lib.mkForce false; + + users = { + mutableUsers = false; + users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBkozy+X96u5ciX766bJ/AyQ3xm1tXZTIr5+4PVFZFi" + ]; + }; + + security.sudo.wheelNeedsPassword = false; + + environment.systemPackages = with pkgs; [ + curl + dysk + fd + fish + git + htop + jq + mtr + pciutils + powertop + ripgrep + tcpdump + traceroute + vim + wireguard-tools + ]; +} |
