Refactor configuration.nix using attribute sets
This commit is contained in:
parent
9aa4f91d33
commit
38ca59706d
|
@ -10,6 +10,7 @@
|
||||||
CLOSED: [2019-10-18 Fri 00:03]
|
CLOSED: [2019-10-18 Fri 00:03]
|
||||||
*** TODO Tmux
|
*** TODO Tmux
|
||||||
*** TODO Smartmontools
|
*** TODO Smartmontools
|
||||||
|
*** TODO Zeroconf
|
||||||
** Printing
|
** Printing
|
||||||
*** TODO Cups
|
*** TODO Cups
|
||||||
*** TODO SANE
|
*** TODO SANE
|
||||||
|
|
|
@ -10,16 +10,20 @@
|
||||||
|
|
||||||
# A bunch of boot parameters needed for optimal runtime on RPi 3B
|
# A bunch of boot parameters needed for optimal runtime on RPi 3B
|
||||||
boot.kernelParams = ["cma=32M"];
|
boot.kernelParams = ["cma=32M"];
|
||||||
boot.loader.raspberryPi.enable = true;
|
boot.loader.raspberryPi = {
|
||||||
boot.loader.raspberryPi.version = 3;
|
enable = true;
|
||||||
boot.loader.raspberryPi.uboot.enable = true;
|
version = 3;
|
||||||
boot.loader.raspberryPi.firmwareConfig = ''
|
uboot.enable = true;
|
||||||
|
firmwareConfig = ''
|
||||||
hdmi_force_hotplug=1
|
hdmi_force_hotplug=1
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
raspberrypi-tools
|
raspberrypi-tools
|
||||||
(import ./vim.nix)
|
(import ./vim.nix)
|
||||||
git
|
git
|
||||||
|
tmux
|
||||||
];
|
];
|
||||||
|
|
||||||
# File systems configuration for using the installer's partition layout
|
# File systems configuration for using the installer's partition layout
|
||||||
|
@ -34,8 +38,10 @@
|
||||||
swapDevices = [ { device = "/swapfile"; size = 1024; } ];
|
swapDevices = [ { device = "/swapfile"; size = 1024; } ];
|
||||||
|
|
||||||
# Configure basic SSH access
|
# Configure basic SSH access
|
||||||
services.openssh.enable = true;
|
services.openssh = {
|
||||||
services.openssh.permitRootLogin = "yes";
|
enable = true;
|
||||||
|
permitRootLogin = "yes";
|
||||||
|
};
|
||||||
|
|
||||||
# Cleanup tmp on startup
|
# Cleanup tmp on startup
|
||||||
boot.cleanTmpDir = true;
|
boot.cleanTmpDir = true;
|
||||||
|
@ -54,7 +60,6 @@
|
||||||
# Set vim as default editor
|
# Set vim as default editor
|
||||||
programs.vim.defaultEditor = true;
|
programs.vim.defaultEditor = true;
|
||||||
|
|
||||||
|
|
||||||
# Set timezone and synchronize NTP
|
# Set timezone and synchronize NTP
|
||||||
time.timeZone = "Europe/Brussels";
|
time.timeZone = "Europe/Brussels";
|
||||||
services.timesyncd.enable = true;
|
services.timesyncd.enable = true;
|
||||||
|
@ -64,12 +69,17 @@
|
||||||
boot.supportedFilesystems = [ "zfs" ];
|
boot.supportedFilesystems = [ "zfs" ];
|
||||||
|
|
||||||
# Scrub zpool monthly
|
# Scrub zpool monthly
|
||||||
services.zfs.autoScrub.enable = true;
|
services.zfs.autoScrub = {
|
||||||
services.zfs.autoScrub.interval = "monthly";
|
enable = true;
|
||||||
|
interval = "monthly";
|
||||||
|
};
|
||||||
|
|
||||||
# Auto-upgrade the system and reboot if needed
|
# Auto-upgrade the system and reboot if needed
|
||||||
system.autoUpgrade.enable = true;
|
system.autoUpgrade = {
|
||||||
system.autoUpgrade.allowReboot = true;
|
enable = true;
|
||||||
|
allowReboot = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
# Import other configuration modules
|
# Import other configuration modules
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue