2021-10-14 16:11:56 +02:00
|
|
|
|
{ hostRegistry, config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
boot.initrd.availableKernelModules = [ "usbhid" ];
|
|
|
|
|
boot.initrd.kernelModules = [ ];
|
|
|
|
|
boot.kernelModules = [ ];
|
|
|
|
|
boot.extraModulePackages = [ ];
|
|
|
|
|
|
|
|
|
|
fileSystems."/" = {
|
|
|
|
|
device = "/dev/disk/by-label/NIXOS_SD";
|
|
|
|
|
fsType = "ext4";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fileSystems."/boot/firmware" = {
|
|
|
|
|
device = "/dev/disk/by-label/FIRMWARE";
|
|
|
|
|
fsType = "vfat";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
swapDevices = [ ];
|
|
|
|
|
|
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
|
#networking.wireless.enable = true;
|
|
|
|
|
hardware.deviceTree.enable = false;
|
|
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
|
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
|
loader = {
|
|
|
|
|
grub.enable = false;
|
|
|
|
|
generic-extlinux-compatible.enable = lib.mkDefault true;
|
|
|
|
|
raspberryPi = {
|
|
|
|
|
enable = true;
|
|
|
|
|
version = 4;
|
|
|
|
|
uboot.enable = true;
|
|
|
|
|
firmwareConfig = ''
|
|
|
|
|
gpu_mem=192
|
|
|
|
|
dtparam=audio=on
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
2021-10-19 01:26:48 +02:00
|
|
|
|
# TODO: can be removed when https://github.com/NixOS/nixpkgs/pull/142015 is merged
|
|
|
|
|
kernelPatches = [{
|
|
|
|
|
name = "disable-FB_SIMPLE";
|
|
|
|
|
patch = null;
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
FB_SIMPLE m
|
|
|
|
|
'';
|
|
|
|
|
}];
|
2021-10-14 16:11:56 +02:00
|
|
|
|
|
|
|
|
|
tmpOnTmpfs = true;
|
|
|
|
|
};
|
|
|
|
|
sdImage = {
|
|
|
|
|
compressImage = false;
|
|
|
|
|
imageBaseName = config.networking.hostName;
|
|
|
|
|
firmwareSize = 512;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
c3d2 = {
|
|
|
|
|
isInHq = false;
|
|
|
|
|
hq.statistics.enable = true;
|
2021-10-29 03:48:59 +02:00
|
|
|
|
pi-sensors = if true then [] else [ {
|
2021-10-14 16:11:56 +02:00
|
|
|
|
type = "dht22";
|
|
|
|
|
pin = 17;
|
|
|
|
|
location = "Schrank";
|
|
|
|
|
} {
|
|
|
|
|
type = "dht22";
|
|
|
|
|
pin = 23;
|
|
|
|
|
location = "Aussen";
|
|
|
|
|
} ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
|
buildCores = 4;
|
|
|
|
|
maxJobs = 2;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
|
hostName = "radiobert"; # Define your hostname.
|
|
|
|
|
useDHCP = false;
|
|
|
|
|
interfaces.eth0.ipv4.addresses = [{
|
|
|
|
|
address = hostRegistry.hosts.${config.networking.hostName}.ip4;
|
|
|
|
|
prefixLength = 26;
|
|
|
|
|
}];
|
|
|
|
|
defaultGateway = "172.20.73.1";
|
|
|
|
|
firewall.enable = false;
|
|
|
|
|
nameservers = [ "172.20.73.8" "9.9.9.9" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
libraspberrypi
|
|
|
|
|
raspberrypi-eeprom
|
|
|
|
|
vim
|
|
|
|
|
wget
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
programs.tmux.enable = true;
|
|
|
|
|
|
|
|
|
|
# Do not log to flash:
|
|
|
|
|
services.journald.extraConfig = ''
|
|
|
|
|
Storage=volatile
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Allow access to USB
|
|
|
|
|
services.udev.extraRules = ''
|
|
|
|
|
SUBSYSTEM=="usb", MODE:="0666"
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "21.05"; # Did you read the comment?
|
|
|
|
|
}
|