pulsebert: back to pi
This commit is contained in:
parent
4296b8d979
commit
96284491ff
|
@ -508,9 +508,13 @@
|
||||||
pulsebert = nixosSystem' {
|
pulsebert = nixosSystem' {
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/pulsebert
|
./hosts/pulsebert
|
||||||
|
# build: outputs.nixosConfigurations.pulsebert.config.system.build.sdImage
|
||||||
|
# run: unzstd -cd result/sd-image/nixos-sd-image-*-aarch64-linux.img.zst | pv -br | sudo dd bs=4M of=/dev/sdX
|
||||||
|
"${inputs.nixos-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-new-kernel.nix"
|
||||||
];
|
];
|
||||||
nixpkgs = inputs.nixos-unstable;
|
nixpkgs = inputs.nixos-unstable;
|
||||||
system = "x86_64-linux";
|
# system = "x86_64-linux";
|
||||||
|
system = "aarch64-linux";
|
||||||
};
|
};
|
||||||
|
|
||||||
radiobert = nixosSystem' {
|
radiobert = nixosSystem' {
|
||||||
|
|
|
@ -8,24 +8,42 @@
|
||||||
c3d2 = {
|
c3d2 = {
|
||||||
isInHq = true;
|
isInHq = true;
|
||||||
mergeHostsFile = true;
|
mergeHostsFile = true;
|
||||||
hq.interface = "enp1s0";
|
# hq.interface = "enp1s0";
|
||||||
|
hq.interface = "eth0";
|
||||||
hq.statistics.enable = true;
|
hq.statistics.enable = true;
|
||||||
k-ot.enable = true;
|
k-ot.enable = true;
|
||||||
audioServer.enable = true;
|
audioServer.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader.systemd-boot = {
|
growPartition = true;
|
||||||
enable = true;
|
# kernelPatches = [{
|
||||||
configurationLimit = 2;
|
# # name = "crashdump-config";
|
||||||
|
# patch = null;
|
||||||
|
# extraConfig = ''
|
||||||
|
# SND_SOC_RT5670 m
|
||||||
|
# '';
|
||||||
|
# }];
|
||||||
|
# kernelPackages = pkgs.linuxKernel.packages.linux_5_15;
|
||||||
|
kernelParams = [ "console=tty0" ];
|
||||||
|
loader = {
|
||||||
|
grub.enable = false;
|
||||||
|
# systemd-boot = {
|
||||||
|
# enable = true;
|
||||||
|
# configurationLimit = 2;
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
loader.efi.canTouchEfiVariables = true;
|
loader.efi.canTouchEfiVariables = true;
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
supportedFilesystems = lib.mkForce [ "vfat" "ext4" ];
|
||||||
tmpOnTmpfs = true;
|
tmpOnTmpfs = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
bluetooth.enable = false; # has no wireless hardware
|
bluetooth.enable = false; # has no wireless hardware
|
||||||
|
deviceTree = {
|
||||||
|
enable = true;
|
||||||
|
kernelPackage = config.boot.kernelPackages.kernel;
|
||||||
|
};
|
||||||
enableRedistributableFirmware = true;
|
enableRedistributableFirmware = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -34,6 +52,12 @@
|
||||||
maxJobs = 1;
|
maxJobs = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
|
makeModulesClosure = x:
|
||||||
|
# prevent kernel install fail due to missing modules
|
||||||
|
pkgs.makeModulesClosure (x // { allowMissing = true; });
|
||||||
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
|
@ -50,7 +74,8 @@
|
||||||
hostName = "pulsebert";
|
hostName = "pulsebert";
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
interfaces = {
|
interfaces = {
|
||||||
enp1s0.useDHCP = true;
|
# enp1s0.useDHCP = true;
|
||||||
|
eth0.useDHCP = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -64,6 +89,60 @@
|
||||||
|
|
||||||
programs.tmux.enable = true;
|
programs.tmux.enable = true;
|
||||||
|
|
||||||
|
# https://github.com/dump-dvb/nix-config/blob/310ceedca5ab2d5c22070bd73c603926b6100a74/hardware/configuration-rpi-3b.nix#L16
|
||||||
|
sdImage = lib.mkForce {
|
||||||
|
populateFirmwareCommands = let
|
||||||
|
configTxt = pkgs.writeText "config.txt" ''
|
||||||
|
[pi3]
|
||||||
|
kernel=u-boot-rpi3.bin
|
||||||
|
hdmi_force_hotplug=1
|
||||||
|
[pi02]
|
||||||
|
kernel=u-boot-rpi3.bin
|
||||||
|
[pi4]
|
||||||
|
kernel=u-boot-rpi4.bin
|
||||||
|
enable_gic=1
|
||||||
|
armstub=armstub8-gic.bin
|
||||||
|
# Otherwise the resolution will be weird in most cases, compared to
|
||||||
|
# what the pi3 firmware does by default.
|
||||||
|
disable_overscan=1
|
||||||
|
# Supported in newer board revisions
|
||||||
|
arm_boost=1
|
||||||
|
[cm4]
|
||||||
|
# Enable host mode on the 2711 built-in XHCI USB controller.
|
||||||
|
# This line should be removed if the legacy DWC2 controller is required
|
||||||
|
# (e.g. for USB device mode) or if USB support is not required.
|
||||||
|
otg_mode=1
|
||||||
|
[all]
|
||||||
|
# Boot in 64-bit mode.
|
||||||
|
arm_64bit=1
|
||||||
|
# U-Boot needs this to work, regardless of whether UART is actually used or not.
|
||||||
|
# Look in arch/arm/mach-bcm283x/Kconfig in the U-Boot tree to see if this is still
|
||||||
|
# a requirement in the future.
|
||||||
|
enable_uart=1
|
||||||
|
# Prevent the firmware from smashing the framebuffer setup done by the mainline kernel
|
||||||
|
# when attempting to show low-voltage or overtemperature warnings.
|
||||||
|
avoid_warnings=1
|
||||||
|
'';
|
||||||
|
in ''
|
||||||
|
(cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/firmware/)
|
||||||
|
# Add the config
|
||||||
|
cp ${configTxt} firmware/config.txt
|
||||||
|
# Add pi3 specific files
|
||||||
|
cp ${pkgs.ubootRaspberryPi3_64bit}/u-boot.bin firmware/u-boot-rpi3.bin
|
||||||
|
# Add pi4 specific files
|
||||||
|
cp ${pkgs.ubootRaspberryPi4_64bit}/u-boot.bin firmware/u-boot-rpi4.bin
|
||||||
|
cp ${pkgs.raspberrypi-armstubs}/armstub8-gic.bin firmware/armstub8-gic.bin
|
||||||
|
cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-4-b.dtb firmware/
|
||||||
|
cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-400.dtb firmware/
|
||||||
|
cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-cm4.dtb firmware/
|
||||||
|
cp ${pkgs.raspberrypifw}/share/raspberrypi/boot/bcm2711-rpi-cm4s.dtb firmware/
|
||||||
|
'';
|
||||||
|
populateRootCommands = ''
|
||||||
|
mkdir -p ./files/boot
|
||||||
|
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
security = {
|
security = {
|
||||||
rtkit.enable = true;
|
rtkit.enable = true;
|
||||||
sudo = {
|
sudo = {
|
||||||
|
@ -77,8 +156,7 @@
|
||||||
# Allow access to printer serial port and GPIO
|
# Allow access to printer serial port and GPIO
|
||||||
"${config.services.octoprint.user}".extraGroups = [ "dialout" ];
|
"${config.services.octoprint.user}".extraGroups = [ "dialout" ];
|
||||||
})
|
})
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|
|
@ -4,34 +4,37 @@
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
#imports =
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
# [ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
# ];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" "sdhci_acpi" ];
|
boot.initrd.availableKernelModules = [ "usbhid" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
# mkForce to get rid of "console=ttyAMA0" from sd-image-aarch64.nix
|
||||||
|
boot.kernelParams = lib.mkForce [
|
||||||
|
"snd_bcm2835.enable_headphones=1"
|
||||||
|
];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{ device = "/dev/disk/by-uuid/dfa5920b-debc-4e60-a33b-ef6a1ef1ed48";
|
device = "/dev/disk/by-label/NIXOS_SD";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot/firmware" = {
|
||||||
{ device = "/dev/disk/by-uuid/D35A-D516";
|
device = "/dev/disk/by-label/FIRMWARE";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
hardware.enableRedistributableFirmware = true;
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
#networking.wireless.enable = true;
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
boot.loader.raspberryPi.firmwareConfig = ''
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
gpu_mem=192
|
||||||
networking.useDHCP = lib.mkDefault true;
|
dtparam=audio=on
|
||||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
'';
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue