mio-ops/profiles/host_common.nix

104 lines
3.2 KiB
Nix
Raw Normal View History

2019-07-02 03:47:20 +00:00
# Configuration common to all my servers
2019-06-27 01:44:00 +00:00
{ config, pkgs, lib, ... }:
{
2019-09-06 06:52:44 +00:00
2020-05-10 22:22:52 +00:00
imports = [
2021-01-25 05:24:10 +00:00
./chrony.nix
2021-06-01 05:50:27 +00:00
../profiles/neovim.nix
2021-05-25 01:40:51 +00:00
../profiles/logrotate.nix
2020-05-10 22:22:52 +00:00
./tmux.nix
2021-03-04 10:48:18 +00:00
./zsh.nix
2020-05-10 22:22:52 +00:00
];
# Common boot settings
boot = {
cleanTmpDir = true; # Clean /tmp on reboot
};
2019-09-06 06:52:44 +00:00
2019-06-27 01:44:00 +00:00
# Select internationalisation properties.
i18n = {
2020-04-21 08:23:43 +00:00
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
2019-06-27 01:44:00 +00:00
};
time.timeZone = "Australia/Brisbane"; # Set your preferred timezone:
2021-05-04 00:16:53 +00:00
documentation.nixos.enable = false; # Disable documentation, save space
2019-06-27 01:44:00 +00:00
# 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
];
2020-09-03 09:14:20 +00:00
fonts.fontconfig.includeUserConf = false;
2020-06-23 02:31:05 +00:00
# Adapted from gchristensen and clever
nix = {
nixPath = [
# Ruin the config so we don't accidentally run
# nixos-rebuild switch on the host
(let
cfg = pkgs.writeText "configuration.nix"
''
assert builtins.trace "This system is managed by NixOps." false;
{}
'';
in "nixos-config=${cfg}")
# Copy the channel version from the deploy host to the target
"nixpkgs=/run/current-system/nixpkgs"
];
gc = {
automatic = true; # Enable Nix garbage collection:
dates = "weekly";
options = "--delete-older-than 90d";
};
autoOptimiseStore = true;
2020-07-14 01:58:38 +00:00
extraOptions = ''
2021-03-14 23:12:55 +00:00
show-trace = true # Enable --show-trace by default for nix
builders-use-substitutes = true # Set builders to use caches
2020-07-14 01:58:38 +00:00
'';
2020-10-21 00:19:48 +00:00
trustedUsers = ["craige"];
2020-06-23 02:31:05 +00:00
};
system.extraSystemBuilderCmds = ''
ln -sv ${pkgs.path} $out/nixpkgs
'';
environment.etc.host-nix-channel.source = pkgs.path;
2019-07-02 03:47:20 +00:00
2019-07-03 13:00:17 +00:00
# Set the system-wide environment
environment = {
systemPackages = with pkgs; [
2021-05-31 00:47:36 +00:00
bat # cat clone with syntax highlighting & Git integration
byobu # text-based window manager and terminal multiplexer.
direnv # A shell extension that manages your environment
dnsutils # Bind DNS utilities
fd # A simple, fast and user-friendly alternative to find
2020-04-07 12:16:37 +00:00
(if config.services.xserver.enable then gitAndTools.gitFull else git) # Distributed version control system
2021-05-31 00:47:36 +00:00
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
ripgrep # Utility that provides usability of The Silver Searcher with the raw speed of grep
2019-07-03 13:00:17 +00:00
];
};
2019-06-27 01:44:00 +00:00
# Users common across MIO Ops:
users.mutableUsers = false; # Remove any users not defined in here
}