confix/cores/base/default.nix

109 lines
2.4 KiB
Nix

# Base configuration.nix
{ config, lib, pkgs, inputs, user, ... }:
{
boot = {
tmp.cleanOnBoot = true;
};
nix = {
settings.auto-optimise-store = true;
settings.allowed-users = [ "@wheel" ];
gc = {
automatic = true;
dates = "weekly";
persistent = true;
options = "--delete-older-than 30d";
};
package = pkgs.nixFlakes;
registry.nixpkgs.flake = inputs.nixpkgs;
extraOptions = ''
experimental-features = nix-command flakes
keep-outputs = true
keep-derivations = true
'';
};
nixpkgs.config.allowUnfree = true;
networking.networkmanager.enable = true;
environment = {
defaultPackages = with pkgs; [
perl
rsync
strace
];
systemPackages = with pkgs; [
bottom
curl
eva
ranger
wget
];
};
programs.git = {
enable = true;
};
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.mtr = {
enable = true;
};
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
programs.tmux = {
enable = true;
clock24 = true;
escapeTime = 250;
historyLimit = 8000;
keyMode = "vi";
newSession = false;
terminal = "screen-256color";
};
services.cron = {
enable = true;
systemCronJobs = [
# Clean logs older than 2d
"0 20 * * * root journalctl --vacuum-time=2d"
];
};
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
};
allowSFTP = false; # Don't set this if you need sftp
extraConfig = ''
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
AllowStreamLocalForwarding no
AuthenticationMethods publickey
'';
};
users.users.${user.name} = {
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" ];
initialPassword = "hunter2";
};
time.timeZone = "${user.timezone}";
i18n = {
defaultLocale = "${user.locale}";
extraLocaleSettings = {
LC_ADDRESS = "${user.locale}";
LC_IDENTIFICATION = "${user.locale}";
LC_MEASUREMENT = "${user.locale}";
LC_MONETARY = "${user.locale}";
LC_NAME = "${user.locale}";
LC_NUMERIC = "${user.locale}";
LC_PAPER = "${user.locale}";
LC_TELEPHONE = "${user.locale}";
LC_TIME = "${user.locale}";
};
};
}