mio-ops/roles/host_common.nix

116 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
imports =
[
];
2019-06-27 01:44:00 +00:00
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "us";
defaultLocale = "en_AU.UTF-8";
};
time.timeZone = "Australia/Brisbane"; # Set your preferred timezone:
# Set security options:
security.sudo.enable = true;
security.sudo.wheelNeedsPassword = false;
2019-07-02 03:47:20 +00:00
# Enable Nix garbage collection:
nix.gc.automatic = true;
nix.gc.dates = "weekly";
nix.gc.options = "--delete-older-than 90d";
2019-08-08 03:53:48 +00:00
nix.autoOptimiseStore = true;
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.
htop # interactive process viewer
tmux # Terminal multiplexer required by byobu
git # Distributed version control system
powerline-fonts # For zsh themes
lsof # list open files
2019-11-12 23:30:29 +00:00
direnv # A shell extension that manages your environment
2019-09-10 11:13:48 +00:00
(
2019-11-12 23:31:26 +00:00
import ../deployments/vim.nix
2019-09-10 11:13:48 +00:00
)
2019-07-03 13:00:17 +00:00
];
};
2019-07-02 03:12:01 +00:00
# Program defauls for Linode VMs
2019-07-02 03:47:20 +00:00
programs.zsh = {
enable = true;
autosuggestions = {
enable = true;
};
2019-11-12 23:30:29 +00:00
interactiveShellInit = ''
eval "$(direnv hook zsh)"
'';
2019-07-03 13:00:17 +00:00
# List of strings concatenated with "\n"
#loginShellInit = ''
2019-07-05 12:05:44 +00:00
# _byobu_sourced=1 . byobu 2>/dev/null || true
2019-07-03 13:00:17 +00:00
#'';
ohMyZsh = {
2019-07-02 03:47:20 +00:00
enable = true;
2019-07-05 13:10:37 +00:00
plugins = [ "git" "tmux" ];
2019-07-05 12:52:28 +00:00
theme = "agnoster";
2019-07-02 03:47:20 +00:00
};
};
2019-07-03 13:00:17 +00:00
programs.mosh = {
enable = true;
withUtempter = true;
};
2019-07-02 03:12:01 +00:00
2019-06-27 01:44:00 +00:00
# List services that you want to enable:
2019-07-03 13:00:17 +00:00
services.openssh = {
enable = true; # Enable the OpenSSH daemon.
permitRootLogin = "without-password";
challengeResponseAuthentication = false;
passwordAuthentication = false;
openFirewall = true;
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
};
2019-06-27 01:44:00 +00:00
2019-07-02 03:12:01 +00:00
# Set the default shell for all users
users.defaultUserShell = "/run/current-system/sw/bin/zsh";
2019-06-27 01:44:00 +00:00
# Users common across MIO Ops:
users.mutableUsers = false; # Remove any users not defined in here
users.users.root = {
2019-07-03 13:00:17 +00:00
hashedPassword = "$6$yak.T2uXItw5j2tU$E5kW9iDMXBc86voxJjxnrUcY0DrW/7WaQY0aGZ5sIJ2JPYZOhDslTKqOYK8sDSJGhM/mCxjPbJq4JGFsObN7D1";
2019-06-27 01:44:00 +00:00
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDtjE0YstRzlh+Zhlj03th9DYOkMqJ5xHUcderBq151K craige@mcwhirter.io"
2019-10-15 14:29:33 +00:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID7qAXTCAnqq+3ks4L8/2f4J8RxmrFaMOCA7m9ImbW2m craige@sealgair"
2019-06-27 01:44:00 +00:00
];
};
# MIO Ops groups:
users.groups.craige.gid = 1000;
# MIO Ops Users
users.users.craige = {
isNormalUser = true;
uid = 1000;
group = "craige";
extraGroups = ["wheel" ];
2019-07-03 13:00:17 +00:00
hashedPassword = "$6$ZNvCXNzwtdeV0pd$iKraghNGImwzx3IhVk6.wi6Bl7yFS6jLbxm9zeE4xq6.WLkYtVnnP323bstos8sVhD4L9Z21gMGVY3MLtmvlH0";
2019-06-27 01:44:00 +00:00
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDtjE0YstRzlh+Zhlj03th9DYOkMqJ5xHUcderBq151K craige@mcwhirter.io"
2019-10-15 14:29:33 +00:00
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID7qAXTCAnqq+3ks4L8/2f4J8RxmrFaMOCA7m9ImbW2m craige@sealgair"
2019-06-27 01:44:00 +00:00
];
};
}