This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config/nixos/common.nix

227 lines
6.4 KiB
Nix
Raw Normal View History

2024-04-29 09:22:17 -05:00
{ inputs, pkgs, ... }:
{
2024-04-29 09:22:17 -05:00
imports = [
../cachix.nix
inputs.sops-nix.nixosModules.sops
];
sops = {
2024-05-28 16:42:34 -05:00
defaultSopsFile = ../secrets.sops.yaml;
2024-04-29 09:22:17 -05:00
validateSopsFiles = false;
age = {
# Derives sops private key from host ssh private key and places it at /var/lib/sops-nix/key.txt.
2024-04-29 09:25:48 -05:00
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
2024-04-29 09:22:17 -05:00
keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true;
};
# # Mounts unencrypted sops values at /run/secrets/rndc_keys accessible by root only by default.
# secrets = {
# rndc_keys = {};
# };
};
# Bootloader.
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
supportedFilesystems = [ "nfs" ];
kernelModules = [ "nfs" ];
};
};
fileSystems."/mnt/borg" = {
device = "10.1.1.13:/eru/borg";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
2024-04-04 14:17:51 -05:00
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
trusted-users = [ "root" "jahanson" ];
extra-substituters = "https://cache.garnix.io";
extra-trusted-public-keys = "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=";
};
# Enable fish
programs.fish.enable = true;
# root ssh keys
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsUe5YF5z8vGcEYtQX7AAiw2rJygGf2l7xxr8nZZa7w"
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBH3VVFenoJfnu+IFUlD79uxl7L8SFoRup33J2HGny4WEdRgGR41s0MpFKDBmxXZHy4O9Nh8NMMnpy5VhUefnIKI="
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPHFQ3hDjjrKsecn3jmSWYlRXy4IJCrepgU1HaIV5VcmB3mUFmIZ/pCZnPmIG/Gbuqf1PP2FQDmHMX5t0hTYG9A="
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETR70eQJiXaJuB+qpI1z+jFOPbEZoQNRcq4VXkojWfU"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAanHn3AWxWfHv51wgDmJwhQrJgsGd+LomJJZ5kXFTP3 jahanson@durincore"
2024-02-23 12:02:42 -06:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIATyScd8ZRhV7uZmrQNSAbRTs9N/Dbx+Y8tGEDny30sA jahanson@Anduril"
2024-04-12 09:07:28 -05:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO/W445gX2IINRbE6crIMwgN6Ks8LTzAXR86pS9xp335 Sting"
2024-05-28 16:08:12 -05:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBROTzSefJGJeCNUgNLbE5l4sHHg2fHUO4sCwqvP+zAd Gollum"
2024-07-13 02:25:36 -05:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAGSFTSVPt43PBpSMSF1dGTzN2JbxztDZUml7g4+PnWe CSI-Driver@talos"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIDJtqzSFK3MN12Lo3Y4DnzJV5NiygIPkR+gun5oEb2q jahanson@legion-new"
];
# Set up users
users.users.jahanson = {
isNormalUser = true;
description = "Joseph Hanson";
2024-05-28 17:20:37 -05:00
extraGroups = [ "networkmanager" "wheel" "kah" ];
shell = pkgs.fish;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBsUe5YF5z8vGcEYtQX7AAiw2rJygGf2l7xxr8nZZa7w"
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBH3VVFenoJfnu+IFUlD79uxl7L8SFoRup33J2HGny4WEdRgGR41s0MpFKDBmxXZHy4O9Nh8NMMnpy5VhUefnIKI="
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPHFQ3hDjjrKsecn3jmSWYlRXy4IJCrepgU1HaIV5VcmB3mUFmIZ/pCZnPmIG/Gbuqf1PP2FQDmHMX5t0hTYG9A="
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIETR70eQJiXaJuB+qpI1z+jFOPbEZoQNRcq4VXkojWfU"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAanHn3AWxWfHv51wgDmJwhQrJgsGd+LomJJZ5kXFTP3 jahanson@durincore"
2024-02-23 12:02:42 -06:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIATyScd8ZRhV7uZmrQNSAbRTs9N/Dbx+Y8tGEDny30sA jahanson@Anduril"
2024-07-13 02:25:36 -05:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIDJtqzSFK3MN12Lo3Y4DnzJV5NiygIPkR+gun5oEb2q jahanson@legion-new"
];
2024-02-23 12:02:42 -06:00
};
2024-05-28 17:20:37 -05:00
# extra user for containers
users.users.kah = {
uid = 568;
group = "kah";
};
users.groups.kah = {};
# Default editor
environment.variables.EDITOR = "vim";
# Time zone.
time.timeZone = "America/Chicago";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
git
wget
curl
vim
lazygit
tailscale
python3
ansible
smartmontools
nfs-utils
2024-03-05 18:30:38 -06:00
borgbackup
borgmatic
2024-03-10 22:24:59 -05:00
#utils
ripgrep # recursively searches directories for a regex pattern
jq # A lightweight and flexible command-line JSON processor
yq-go # yaml processer https://github.com/mikefarah/yq
fzf # A command-line fuzzy finder
age # sops-age encryption
sops
lsd
#misc
cowsay
file
which
tree
gnused
gnutar
gawk
zstd
gnupg
fastfetch
atuin
go-task
# archives
zip
xz
unzip
p7zip
# terminal file managers
nnn
ranger
yazi
# networking tools
iperf3
dnsutils # `dig` + `nslookup`
ldns # replacement of `dig`, it provide the command `drill`
aria2 # A lightweight multi-protocol & multi-source command-line download utility
socat # replacement of openbsd-netcat
nmap # A utility for network discovery and security auditing
ipcalc # it is a calculator for the IPv4/v6 addresses
# system tools
sysstat
lm_sensors # for `sensors` command
ethtool
pciutils # lspci
usbutils # lsusb
# system call monitoring
strace # system call monitoring
ltrace # library call monitoring
lsof # list open files
btop # replacement of htop/nmon
iotop # io monitoring
iftop # network monitoring
# utils
direnv # shell environment management
pre-commit # Pre-commit tasks for git
minio-client # S3 management
shellcheck
envsubst
2024-04-08 19:41:26 -05:00
# nix tools
nvd
2024-03-10 22:24:59 -05:00
];
# my traceroute
programs.mtr.enable = true;
2024-03-10 22:24:59 -05:00
# starship - an customizable prompt for any shell
programs.starship = {
enable = true;
# custom settings
settings = {
add_newline = false;
aws.disabled = true;
gcloud.disabled = true;
line_break.disabled = true;
username = {
disabled = false;
show_always = true;
format = "[$user]($style)@";
};
hostname ={
disabled = false;
ssh_only = false;
format = "[$hostname]($style) ";
ssh_symbol = "";
};
};
};
# Enable/Start Tailscale service
services.tailscale.enable = true;
2024-02-23 12:02:42 -06:00
}