nixos-config/modules/generic.nix

95 lines
1.9 KiB
Nix
Raw Normal View History

2021-11-07 11:44:06 +01:00
{ config, pkgs, ... }:
2021-11-06 00:07:40 +01:00
let
sshPubkeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE+X4vceRi79FLwwyzFzxNvaQlolQFrpYn0N4bgdLLaI root@hardlyworking"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFyGaBZIZYjiBhOFD2drvG316B9NUVSbMpTIhOCQur8P arch"
];
in
{
users.users = {
root.openssh.authorizedKeys.keys = sshPubkeys;
mc-fucker = {
isNormalUser = true;
openssh.authorizedKeys.keys = sshPubkeys;
hashedPassword = "$6$VlNqS5D2uxmzs$AXEEg63iQ5bMQDtU9.Cy4cd/UfQCHk9QNo2RuQmucNz6Y4Z2l0qM5lvr6KFcEdJi6vO7mYd761LrVrQ8J7nPw1";
extraGroups = [ "wheel" ];
};
};
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_GB.UTF-8";
zramSwap = {
enable = true;
2021-11-06 13:01:22 +01:00
memoryPercent = 200;
2021-11-06 00:07:40 +01:00
algorithm = "lzo-rle";
};
programs = {
zsh = import ./zsh.nix;
atop = {
enable = true;
2021-11-06 19:00:02 +01:00
netatop.enable = true;
2021-11-06 00:07:40 +01:00
};
vim.defaultEditor = true;
2021-11-06 00:07:40 +01:00
};
systemd.services.atop.environment = {
LOGINTERVAL = "60";
LOGGENERATIONS = "14";
};
2021-11-06 00:07:40 +01:00
users.defaultUserShell = pkgs.zsh;
security.sudo.wheelNeedsPassword = false;
system.autoUpgrade = {
enable = true;
2022-02-02 01:35:03 +01:00
allowReboot = true;
2021-12-21 14:55:34 +01:00
dates = "04:00";
randomizedDelaySec = "30min";
2021-11-06 00:07:40 +01:00
};
services = {
openssh = {
enable = true;
passwordAuthentication = false;
extraConfig = "ClientAliveInterval 60";
2021-11-06 00:07:40 +01:00
};
2021-11-07 11:44:06 +01:00
tailscale.enable = true;
};
networking.firewall = {
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
2021-11-06 00:07:40 +01:00
};
boot.loader.timeout = 1;
2021-11-06 00:07:40 +01:00
environment.systemPackages = with pkgs; [
wget
htop
git
screen
rxvt_unicode.terminfo
2021-11-07 11:44:06 +01:00
nmap
dig
2021-11-23 12:41:14 +01:00
rclone
2022-03-29 15:18:38 +02:00
pv
2022-06-06 03:19:52 +02:00
exa
2021-11-06 00:07:40 +01:00
(import ./vim.nix)
];
2021-12-08 10:58:46 +01:00
2021-12-21 14:55:34 +01:00
nix.gc = {
automatic = true;
options = "--delete-older-than 2d";
};
2022-05-09 15:27:22 +02:00
boot.cleanTmpDir = true;
2021-12-08 10:58:46 +01:00
imports = [
./zabbix-agent.nix
];
2021-11-06 00:07:40 +01:00
}
2021-11-17 10:20:02 +01:00
# vim: set et ts=2 sw=2 ai: