zion/configuration.nix

109 lines
3.1 KiB
Nix
Raw Normal View History

2019-10-11 14:26:37 +02:00
{ config, pkgs, lib, ... }:
{
# NixOS wants to enable GRUB by default
boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
2019-10-11 19:14:18 +02:00
# A bunch of boot parameters needed for optimal runtime on RPi 3B
boot.kernelParams = ["cma=32M"];
boot.loader.raspberryPi = {
enable = true;
version = 3;
uboot.enable = true;
firmwareConfig = ''
hdmi_force_hotplug=1
'';
};
2019-10-11 19:14:18 +02:00
environment.systemPackages = with pkgs; [
raspberrypi-tools
2019-10-17 22:41:08 +02:00
git
tmux
2019-11-06 23:04:16 +01:00
htop
2019-11-06 23:40:47 +01:00
vim
2019-10-11 19:14:18 +02:00
];
2019-10-11 14:26:37 +02:00
# !!! Adding a swap file is optional, but strongly recommended!
swapDevices = [ { device = "/swapfile"; size = 1024; } ];
2019-10-11 19:14:18 +02:00
# Configure basic SSH access
services.openssh = {
enable = true;
permitRootLogin = "yes";
};
2019-10-15 00:18:57 +02:00
# Cleanup tmp on startup
boot.cleanTmpDir = true;
# Set hostname
networking.hostName = "zion";
2019-10-16 22:17:37 +02:00
# Create coolneng user
2019-10-16 22:17:37 +02:00
users.users.coolneng = {
isNormalUser = true;
home = "/home/coolneng";
2019-11-06 23:04:16 +01:00
extraGroups = [ "wheel" "lp" "scanner" ];
2019-10-16 22:17:37 +02:00
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDG7JtfAqcbZV28wkNTfSWSqTOo5buH+dyT0w6SlTqq+KFh5DxREB0yGuM1UfjLpyLQ0XI7UbhCwNG28Li4yv/hwPGq63TF1kl+w4sjQKFn4bOUv1NvsfSN3oTamjfYoVsrapCiXqOvZkzEKMF47MSwOfPkqZ6ihU5V3INA0IZbl1Ri+r9MsIzvY76ZHBiF6rVqQJjdXVDbcLMViOrM56FpyK+ICo+uTkErsEbYFwevVTv9memOh778RRPesBobpZjggWOI4HXXxqk35myInYjHve9K4ox6YZMjwnwnEftONr2HyoBBcBNT+wWd1jtYxCoCWQ3vVkn4LGBDOQ3+HKb4rT3JxI66VfFyQWGJPdgJL5/ZNRlBqA7CpAtE7JaR6l7d3mCCoGW2B0atWiEXecwb8dz4CzzYm1r9Wz27L74OtPzUqcV7mQjCVDcnRsY/MtfhzyWzhB3tujVqnRtF3VrFSrm0YXS1ZWG4dltX1cfgud8s8XwwBKcFw5NdCrVxq3nRMNlGcSqbXC+RnrkK/i6ciAriZdXgFrmnBl+6qEmqIO15u2IPvDhnQs18DzRkHnPQegphhHhHix5aaqNbLfSRZNCTQaqE774X+0kuU/RWylI4muIyf4k9x+et4txeU2OC6l0W0LMpbsELzXIRr/ZBFrGHbE7/KLi8HNiAJ0KmAQ== coolneng@monolith" ];
2019-11-15 00:55:48 +01:00
shell = "/run/current-system/sw/bin/fish";
2019-10-16 22:17:37 +02:00
};
# Set vim as default editor
programs.vim.defaultEditor = true;
2019-10-17 23:20:21 +02:00
# Set timezone and synchronize NTP
time.timeZone = "Europe/Brussels";
services.timesyncd.enable = true;
2019-10-18 00:31:34 +02:00
# Enable zfs support
networking.hostId = "bb26c304";
boot.supportedFilesystems = [ "zfs" ];
2019-11-06 23:04:16 +01:00
boot.zfs.extraPools = [ "vault" ];
2019-10-18 00:31:34 +02:00
# Scrub zpool monthly
services.zfs.autoScrub = {
enable = true;
interval = "monthly";
};
2019-10-18 00:31:34 +02:00
# Auto-upgrade the system and reboot if needed
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
2019-10-23 00:51:57 +02:00
# Enable zeroconf
services.avahi = {
enable = true;
nssmdns = true;
publish = {
enable = true;
userServices = true;
};
};
2019-11-07 14:25:27 +01:00
# Run Nix garbage collector daily
nix.gc = {
automatic = true;
dates = "03:15";
};
2019-11-06 23:04:16 +01:00
# Configure fish shell
2019-11-15 00:55:48 +01:00
programs.fish.enable = true;
users.users.root.shell = "/run/current-system/sw/bin/fish";
2019-11-06 23:04:16 +01:00
2019-10-23 00:51:57 +02:00
# Start a tmux session
2019-11-06 23:04:16 +01:00
#programs.tmux.enable = true;
# Import other configuration modules
2019-11-06 23:04:16 +01:00
imports = [
./modules/printing.nix
./modules/networking.nix
2019-11-07 14:25:27 +01:00
./modules/datasync.nix
./modules/hardware-configuration.nix
2019-11-10 23:40:31 +01:00
./modules/webstack.nix
2019-11-16 10:55:10 +01:00
./modules/devops.nix
2019-11-06 23:04:16 +01:00
];
2019-10-23 00:51:57 +02:00
2019-10-11 14:26:37 +02:00
}