nixos/systems/raspi4/default.nix

55 lines
1.3 KiB
Nix
Raw Normal View History

2022-03-15 17:18:44 +01:00
{ inputs, hostname, ip, pkgs, ... }:
2022-03-15 16:56:05 +01:00
{
imports = [
2022-03-15 17:17:06 +01:00
inputs.nixos-hardware.nixosModules.raspberry-pi-4
2022-08-17 20:26:46 +02:00
"${inputs.self}/modules/log-to-ram"
2022-05-06 15:29:24 +02:00
"${inputs.self}/modules/ntp"
"${inputs.self}/modules/syslog"
2022-03-15 16:56:05 +01:00
];
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
hardware.raspberry-pi."4".fkms-3d.enable = true;
hardware.raspberry-pi."4".audio.enable = true;
hardware.pulseaudio.enable = true;
2022-03-15 17:05:10 +01:00
environment.systemPackages = with pkgs; [
2022-04-11 17:09:37 +02:00
libraspberrypi
2022-03-15 17:05:10 +01:00
raspberrypi-eeprom
];
networking = {
useDHCP = false;
hostName = hostname;
hosts = {
"127.0.0.1" = [ "${hostname}.2li.local" ];
ip = [ "${hostname}.2li.local" ];
};
defaultGateway = "10.7.89.1";
nameservers = [ "10.7.89.2" ];
interfaces.eth0.ipv4.addresses = [
{
address = ip;
prefixLength = 24;
}
];
};
2022-03-15 17:05:10 +01:00
environment.shellAliases = {
2022-04-11 17:09:37 +02:00
raspi-cpu = ''
sudo vcgencmd get_throttled && sudo vcgencmd measure_temp
'';
2022-03-15 17:05:10 +01:00
raspi-firmware-update = ''
sudo mount /dev/disk/by-label/FIRMWARE /mnt && \
BOOTFS=/mnt FIRMWARE_RELEASE_STATUS=stable sudo -E rpi-eeprom-update -d -a && \
sudo umount /mnt
2022-03-15 17:05:10 +01:00
'';
};
2022-03-15 16:56:05 +01:00
}