oizys/hosts/algiz/configuration.nix

150 lines
3.2 KiB
Nix
Raw Normal View History

2023-05-03 16:32:06 -05:00
{ inputs, lib, config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
];
security.sudo.wheelNeedsPassword = false;
2023-05-03 22:38:07 -05:00
2023-07-09 11:32:38 -05:00
nixpkgs.config.allowUnfree = true;
2023-07-09 11:38:43 -05:00
2023-05-04 10:57:14 -05:00
nix.package = pkgs.nixUnstable;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
users.defaultUserShell = pkgs.zsh;
2023-05-03 16:32:06 -05:00
users.extraUsers = {
daylin = {
isNormalUser = true;
extraGroups = [ "wheel" "docker" ];
useDefaultShell = true;
initialPassword = "nix";
};
git = {
isNormalUser = true;
};
};
services.resolved.enable = true;
2023-08-07 10:57:28 -05:00
# fail2ban config based on:
# https://www.linode.com/docs/guides/how-to-use-fail2ban-for-ssh-brute-force-protection/
services.fail2ban {
enable = true;
maxretry = 5;
bantime = "24h";
jails = {
sshd = ''
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
findtime = 300
bantime = 3600
ignoreip = 127.0.0.1
''
}
}
boot.kernelPackages = pkgs.linuxPackages_latest;
# TODO: convert this to a systemd service/timer
# services.cron = {
# enable = true;
# systemCronJobs = [
# # update repos
# "0 * * * * make -C /home/daylin/git soft-repos"
# # update container so home page is semi-accurate
# "0 2 * * * make -C /home/daylin/git update-soft-serve"
# ];
# };
#
networking.hostName = "algiz";
# added to make using `pip install` work in docker build
networking.nameservers = [
"8.8.8.8"
2023-05-03 16:32:06 -05:00
];
2023-08-07 10:57:28 -05:00
time.timeZone = "America/Chicago";
programs.zsh.enable = true;
virtualisation.docker.enable = true;
2023-05-04 10:57:14 -05:00
2023-08-07 10:57:28 -05:00
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
stdenv.cc.cc
curl # for choosenim
];
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
environment.systemPackages = with pkgs; [
zsh
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
tmux
wget
unzip
less
gnumake
gcc
gnupg
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
curl
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
git
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
vim
neovim
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
starship
atuin
chezmoi
bat
fzf
delta
ripgrep
lsd
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
gh
lazygit
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
nixpkgs-fmt
lazydocker
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
(python3.withPackages (ps: with ps; [ pip ]))
micromamba
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
nodejs
go
rustup
];
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
# allow tcp connections for git.dayl.in (gitea)
networking.firewall = {
enable = true;
allowedTCPPorts = [ 80 443 ];
};
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = false;
2023-05-04 10:57:14 -05:00
2023-08-07 10:57:28 -05:00
users.mutableUsers = false;
2023-05-03 16:32:06 -05:00
2023-08-07 10:57:28 -05:00
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
}
2023-05-03 16:32:06 -05:00