NOflake/systems/NObangers.nix

139 lines
3.1 KiB
Nix
Raw Normal View History

2025-05-22 16:14:59 -07:00
{
2025-05-22 17:46:26 -07:00
config,
pkgs,
lib,
...
2025-05-22 16:14:59 -07:00
}: {
2025-05-22 17:46:26 -07:00
environment.systemPackages = with pkgs; [
raspberrypi-eeprom
];
programs.partition-manager.enable = false;
2025-05-22 16:14:59 -07:00
2025-05-22 17:46:26 -07:00
services.printing.enable = false;
i18n.inputMethod = {};
2025-05-22 16:14:59 -07:00
2025-05-22 17:46:26 -07:00
services.xserver.enable = false;
services.desktopManager.plasma6.enable = false;
2025-05-22 16:14:59 -07:00
2025-05-22 17:46:26 -07:00
services.pipewire.enable = false;
services.pulseaudio.enable = true;
config.hardware.raspberry-pi."4" = {
bluetooth.enable = true;
2025-05-22 18:40:52 -07:00
# fkms-3d.enable = true;
2025-05-22 17:46:26 -07:00
};
users.users.tao = {
isNormalUser = true;
hashedPasswordFile = config.age.secrets.password-tao.path;
extraGroups = ["audio" "video" "wheel" "libvirtd" "dialout" "game"];
shell = pkgs.nushell;
};
2025-05-22 17:37:44 -07:00
2025-05-22 17:46:26 -07:00
boot.loader.systemd-boot.enable = false;
boot.loader.efi.canTouchEfiVariables = false;
2025-05-22 16:14:59 -07:00
2025-05-22 18:40:52 -07:00
# Configure for modesetting in the device tree
hardware.deviceTree = {
overlays = [
# Equivalent to:
# https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/cma-overlay.dts
{
name = "rpi4-cma-overlay";
dtsText = ''
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2711";
fragment@0 {
target = <&cma>;
__overlay__ {
size = <(512 * 1024 * 1024)>;
};
};
};
'';
}
# Equivalent to:
# https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts
{
name = "rpi4-vc4-fkms-v3d-overlay";
dtsText = ''
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2711";
fragment@1 {
target = <&fb>;
__overlay__ {
status = "disabled";
};
};
fragment@2 {
target = <&firmwarekms>;
__overlay__ {
status = "okay";
};
};
fragment@3 {
target = <&v3d>;
__overlay__ {
status = "okay";
};
};
fragment@4 {
target = <&vc4>;
__overlay__ {
status = "okay";
};
};
};
'';
}
];
};
# Also configure the system for modesetting.
services.xserver.videoDrivers = lib.mkBefore [
"modesetting" # Prefer the modesetting driver in X11
"fbdev" # Fallback to fbdev
];
2025-05-22 17:46:26 -07:00
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = ["noatime"];
2025-05-22 16:14:59 -07:00
};
2025-05-22 17:46:26 -07:00
};
nix.buildMachines = [
{
hostName = "nolaptop";
systems = ["x86_64-linux" "i686-linux"];
supportedFeatures = [
"benchmark"
"big-parallel"
"gccarch-znver4"
"kvm"
"nixos-test"
];
}
];
nix.extraOptions = ''
builders-use-substitutes = true
'';
nix.distributedBuilds = true;
2025-05-22 16:14:59 -07:00
2025-05-22 17:46:26 -07:00
networking.hostName = "NObangers";
nixpkgs.hostPlatform = "aarch64-linux";
system.stateVersion = "23.11";
2025-05-22 16:14:59 -07:00
}