mio-ops/roles/host_common.nix
Craige McWhirter 1a41110966
Added hwinfo
2020-06-14 16:17:07 +10:00

100 lines
3 KiB
Nix

# Configuration common to all my servers
{ config, pkgs, lib, ... }:
{
imports = [
./tmux.nix
];
# Common boot settings
boot = {
cleanTmpDir = true; # Clean /tmp on reboot
};
# Select internationalisation properties.
i18n = {
defaultLocale = "en_AU.UTF-8"; # Set the default locale
};
# Set the defaul console properties
console = {
keyMap = "us"; # Set the default console key map
font = "ter-powerline-v16Rv"; # Set the default console font
};
time.timeZone = "Australia/Brisbane"; # Set your preferred timezone:
# Set security options:
security.sudo.enable = true;
security.sudo.wheelNeedsPassword = false;
# Configure and install required fonts
fonts.enableDefaultFonts = true;
fonts.enableFontDir = true;
fonts.fonts = with pkgs; [
powerline-fonts # Required for Powerline prompts
];
# Enable Nix garbage collection:
nix.gc.automatic = true;
nix.gc.dates = "weekly";
nix.gc.options = "--delete-older-than 90d";
nix.autoOptimiseStore = true;
# Set the system-wide environment
environment = {
systemPackages = with pkgs; [
byobu # text-based window manager and terminal multiplexer.
direnv # A shell extension that manages your environment
dnsutils # Bind DNS utilities
(if config.services.xserver.enable then gitAndTools.gitFull else git) # Distributed version control system
htop # interactive process viewer
hwinfo # Hardware detection tool
killall # kill processes by name
lshw # Detailed information on the hardware configuration
lsof # list open files
mosh # Mobile shell (ssh replacement)
ncdu # Disk usage analyzer with an ncurses interface
nix-index # A files database for nixpkgs
#openssl # A cryptographic library that implements the SSL and TLS protocols
powerline-fonts # For zsh themes
ripgrep # Utility that provides usability of The Silver Searcher with the raw speed of grep
(
import ../roles/vim.nix
)
];
variables = {
EDITOR = [ "vim"]; # Set the default editor
};
};
# Program defaults for all hosts
programs.zsh = {
enable = true;
autosuggestions = {
enable = true;
};
interactiveShellInit = ''
export TERM="xterm-256color"
eval "$(direnv hook zsh)"
test -r ~/.dir_colors && eval $(dircolors ~/.dir_colors)
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
'';
ohMyZsh = {
enable = true;
plugins = [ "git" ];
};
promptInit = "source ${pkgs.zsh-powerlevel9k}/share/zsh-powerlevel9k/powerlevel9k.zsh-theme";
};
users.defaultUserShell = pkgs.zsh; # Set the default shell for all users
# Users common across MIO Ops:
users.mutableUsers = false; # Remove any users not defined in here
}