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
|
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;
|
|
|
|
|
2019-12-09 05:09:40 +00:00
|
|
|
# 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;
|
2019-12-09 05:09:40 +00:00
|
|
|
|
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; [
|
2019-08-20 11:04:28 +00:00
|
|
|
byobu # text-based window manager and terminal multiplexer.
|
2020-06-14 06:11:20 +00:00
|
|
|
direnv # A shell extension that manages your environment
|
2020-03-18 23:59:47 +00:00
|
|
|
dnsutils # Bind DNS utilities
|
2021-01-25 05:34:01 +00:00
|
|
|
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
|
2020-05-27 11:53:59 +00:00
|
|
|
htop # interactive process viewer
|
2020-06-14 06:17:07 +00:00
|
|
|
hwinfo # Hardware detection tool
|
2020-06-14 06:11:20 +00:00
|
|
|
killall # kill processes by name
|
|
|
|
lshw # Detailed information on the hardware configuration
|
|
|
|
lsof # list open files
|
2020-05-27 11:53:59 +00:00
|
|
|
mosh # Mobile shell (ssh replacement)
|
2020-04-07 12:21:47 +00:00
|
|
|
ncdu # Disk usage analyzer with an ncurses interface
|
2020-05-05 09:21:21 +00:00
|
|
|
nix-index # A files database for nixpkgs
|
2020-04-21 08:23:43 +00:00
|
|
|
#openssl # A cryptographic library that implements the SSL and TLS protocols
|
2020-06-01 03:10:25 +00:00
|
|
|
ripgrep # Utility that provides usability of The Silver Searcher with the raw speed of grep
|
2019-09-10 11:13:48 +00:00
|
|
|
(
|
2021-03-03 05:52:21 +00:00
|
|
|
import ../profiles/vim.nix
|
2019-09-10 11:13:48 +00:00
|
|
|
)
|
2019-07-03 13:00:17 +00:00
|
|
|
];
|
2019-12-09 05:09:40 +00:00
|
|
|
variables = {
|
|
|
|
EDITOR = [ "vim"]; # Set the default editor
|
|
|
|
};
|
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
|
|
|
|
}
|