Compare commits

...

2 Commits

Author SHA1 Message Date
Ari Gerus 1b0eef2993 modules: move nix registry hack to interactive/graphical hosts
CI / x86_64-linux (push) Successful in 1m12s Details
CI / aarch64-linux (push) Successful in 2m0s Details
Turns out, not really elsewhere.
2024-04-03 14:40:56 +02:00
Ari Gerus 3715c6d77a chore: fmt 2024-03-31 12:23:57 +02:00
7 changed files with 52 additions and 47 deletions

View File

@ -2,8 +2,6 @@
let
meta = import ../meta.nix;
flakes = lib.filterAttrs (name: value: value ? outputs) inputs;
nixRegistry = builtins.mapAttrs (name: v: { flake = v; }) flakes;
in {
imports = with inputs; [
nix-index-database.nixosModules.nix-index
@ -15,7 +13,6 @@ in {
];
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
nix.registry = nixRegistry;
deployment = {
allowLocalDeployment = true;

View File

@ -1,6 +1,8 @@
{ config, lib, pkgs, inputs, ... }:
let
flakes = lib.filterAttrs (name: value: value ? outputs) inputs;
nixRegistry = builtins.mapAttrs (name: v: { flake = v; }) flakes;
# rfkill block 0; rmmod btusb btintel; systemctl restart bluetooth.service; modprobe btintel; modprobe btusb; systemctl restart bluetooth.service; rfkill unblock 0
bt-unfuck = with pkgs;
writeScriptBin "bt-unfuck" ''
@ -17,6 +19,8 @@ let
in {
imports = [ inputs.self.nixosModules.common inputs.home-manager.nixosModule ];
nix.registry = nixRegistry;
home-manager.users.ar = {
home.username = "ar";
home.homeDirectory = "/home/ar";

View File

@ -40,7 +40,6 @@ in {
imports = with inputs.self.nixosModules; [
"${inputs.nixpkgs}/nixos/modules/installer/sd-card/sd-image.nix"
common
# inputs.impermanence.nixosModule
];
nixpkgs.overlays = [ inputs.self.overlays.rpi5 ];

View File

@ -1,11 +1,11 @@
{ stdenv, lib, buildPackages, fetchFromGitHub, perl, buildLinux, rpiVersion, ... } @ args:
{ stdenv, lib, buildPackages, fetchFromGitHub, perl, buildLinux, rpiVersion, ...
}@args:
let
# NOTE: raspberrypifw & raspberryPiWirelessFirmware should be updated with this
modDirVersion = "6.1.73";
tag = "stable_20240124";
in
lib.overrideDerivation (buildLinux (args // {
in lib.overrideDerivation (buildLinux (args // {
version = "${modDirVersion}-${tag}";
inherit modDirVersion;
@ -19,23 +19,24 @@ lib.overrideDerivation (buildLinux (args // {
defconfig = {
"1" = "bcmrpi_defconfig";
"2" = "bcm2709_defconfig";
"3" = if stdenv.hostPlatform.isAarch64 then "bcmrpi3_defconfig" else "bcm2709_defconfig";
"3" = if stdenv.hostPlatform.isAarch64 then
"bcmrpi3_defconfig"
else
"bcm2709_defconfig";
"4" = "bcm2711_defconfig";
"5" = "bcm2712_defconfig";
}.${toString rpiVersion};
features = {
efiBootStub = false;
} // (args.features or {});
features = { efiBootStub = false; } // (args.features or { });
extraMeta = if (rpiVersion < 3) then {
platforms = with lib.platforms; arm;
hydraPlatforms = [];
hydraPlatforms = [ ];
} else {
platforms = with lib.platforms; arm ++ aarch64;
hydraPlatforms = [ "aarch64-linux" ];
};
} // (args.argsOverride or {}))) (oldAttrs: {
} // (args.argsOverride or { }))) (oldAttrs: {
postConfigure = ''
# The v7 defconfig has this set to '-v7' which screws up our modDirVersion.
sed -i $buildRoot/.config -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/'
@ -50,24 +51,27 @@ lib.overrideDerivation (buildLinux (args // {
copyDTB() {
cp -v "$dtbDir/$1" "$dtbDir/$2"
}
'' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv6l-linux"]) ''
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb
copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb
'' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv7l-linux"]) ''
copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb
'' + lib.optionalString (lib.elem stdenv.hostPlatform.system ["armv7l-linux" "aarch64-linux"]) ''
copyDTB bcm2710-rpi-zero-2.dtb bcm2837-rpi-zero-2.dtb
copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb
copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb
copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb
copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb
copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb
'';
'' + lib.optionalString
(lib.elem stdenv.hostPlatform.system [ "armv6l-linux" ]) ''
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero.dtb
copyDTB bcm2708-rpi-zero-w.dtb bcm2835-rpi-zero-w.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-a.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b.dtb
copyDTB bcm2708-rpi-b.dtb bcm2835-rpi-b-rev2.dtb
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-a-plus.dtb
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-b-plus.dtb
copyDTB bcm2708-rpi-b-plus.dtb bcm2835-rpi-zero.dtb
copyDTB bcm2708-rpi-cm.dtb bcm2835-rpi-cm.dtb
'' + lib.optionalString
(lib.elem stdenv.hostPlatform.system [ "armv7l-linux" ]) ''
copyDTB bcm2709-rpi-2-b.dtb bcm2836-rpi-2-b.dtb
'' + lib.optionalString
(lib.elem stdenv.hostPlatform.system [ "armv7l-linux" "aarch64-linux" ]) ''
copyDTB bcm2710-rpi-zero-2.dtb bcm2837-rpi-zero-2.dtb
copyDTB bcm2710-rpi-3-b.dtb bcm2837-rpi-3-b.dtb
copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-a-plus.dtb
copyDTB bcm2710-rpi-3-b-plus.dtb bcm2837-rpi-3-b-plus.dtb
copyDTB bcm2710-rpi-cm3.dtb bcm2837-rpi-cm3.dtb
copyDTB bcm2711-rpi-4-b.dtb bcm2838-rpi-4-b.dtb
'';
})

View File

@ -50,7 +50,8 @@ stdenvNoCC.mkDerivation {
'';
meta = with lib; {
description = "Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W";
description =
"Firmware for builtin Wifi/Bluetooth devices in the Raspberry Pi 3+ and Zero W";
homepage = "https://github.com/RPi-Distro/firmware-nonfree";
license = licenses.unfreeRedistributableFirmware;
platforms = platforms.linux;

View File

@ -1,9 +1,7 @@
{ lib, stdenv, fetchFromGitHub }:
let
inherit (lib) optionals;
in
stdenv.mkDerivation {
let inherit (lib) optionals;
in stdenv.mkDerivation {
pname = "raspberrypi-armstubs";
version = "unstable-2022-07-11";
@ -11,12 +9,11 @@ stdenv.mkDerivation {
owner = "raspberrypi";
repo = "tools";
rev = "439b6198a9b340de5998dd14a26a0d9d38a6bcac";
hash = "sha512-KMHgj73eXHT++IE8DbCsFeJ87ngc9R3XxMUJy4Z3s4/MtMeB9zblADHkyJqz9oyeugeJTrDtuVETPBRo7M4Y8A==";
hash =
"sha512-KMHgj73eXHT++IE8DbCsFeJ87ngc9R3XxMUJy4Z3s4/MtMeB9zblADHkyJqz9oyeugeJTrDtuVETPBRo7M4Y8A==";
};
env.NIX_CFLAGS_COMPILE = toString [
"-march=armv8-a+crc"
];
env.NIX_CFLAGS_COMPILE = toString [ "-march=armv8-a+crc" ];
preConfigure = ''
cd armstubs
@ -31,10 +28,12 @@ stdenv.mkDerivation {
"LD7=${stdenv.cc.targetPrefix}ld"
"OBJCOPY7=${stdenv.cc.targetPrefix}objcopy"
"OBJDUMP7=${stdenv.cc.targetPrefix}objdump"
]
++ optionals (stdenv.isAarch64) [ "armstub8.bin" "armstub8-gic.bin" ]
++ optionals (stdenv.isAarch32) [ "armstub7.bin" "armstub8-32.bin" "armstub8-32-gic.bin" ]
;
] ++ optionals stdenv.isAarch64 [ "armstub8.bin" "armstub8-gic.bin" ]
++ optionals stdenv.isAarch32 [
"armstub7.bin"
"armstub8-32.bin"
"armstub8-32-gic.bin"
];
installPhase = ''
runHook preInstall

View File

@ -27,7 +27,8 @@ stdenvNoCC.mkDerivation rec {
meta = with lib; {
description = "Firmware for the Raspberry Pi board";
homepage = "https://github.com/raspberrypi/firmware";
license = licenses.unfreeRedistributableFirmware; # See https://github.com/raspberrypi/firmware/blob/master/boot/LICENCE.broadcom
license =
licenses.unfreeRedistributableFirmware; # See https://github.com/raspberrypi/firmware/blob/master/boot/LICENCE.broadcom
maintainers = with maintainers; [ dezgeg ];
# Hash mismatch on source, mystery.
# Maybe due to https://github.com/NixOS/nix/issues/847