mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	treewide: apply deadnix and statix
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
			
		||||
# modification of nixpkgs deviceTree.applyOverlays to resolve https://github.com/NixOS/nixpkgs/issues/125354
 | 
			
		||||
# derived from https://github.com/NixOS/nixpkgs/blob/916ca8f2b0c208def051f8ea9760c534a40309db/pkgs/os-specific/linux/device-tree/default.nix
 | 
			
		||||
{ lib, pkgs, stdenvNoCC, dtc, libraspberrypi }:
 | 
			
		||||
{ lib, stdenvNoCC, dtc, libraspberrypi }:
 | 
			
		||||
 | 
			
		||||
with lib; (base: overlays': stdenvNoCC.mkDerivation {
 | 
			
		||||
  name = "device-tree-overlays";
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,3 @@
 | 
			
		||||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  hardware.deviceTree.overlays = [
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
{ config, lib, pkgs, ... }:
 | 
			
		||||
{ config, lib, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.hardware.raspberry-pi."4".dwc2;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
{ config, lib, pkgs, ... }:
 | 
			
		||||
{ config, lib, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.hardware.raspberry-pi."4";
 | 
			
		||||
@@ -57,7 +57,7 @@ in
 | 
			
		||||
        overlays = [ (simple-overlay {
 | 
			
		||||
          target = "i2c0if";
 | 
			
		||||
          status = "okay";
 | 
			
		||||
          frequency = cfg.i2c0.frequency;
 | 
			
		||||
          inherit (cfg.i2c0) frequency;
 | 
			
		||||
        }) ];
 | 
			
		||||
      };
 | 
			
		||||
    })
 | 
			
		||||
@@ -67,7 +67,7 @@ in
 | 
			
		||||
        overlays = [ (simple-overlay {
 | 
			
		||||
          target = "i2c1";
 | 
			
		||||
          status = "okay";
 | 
			
		||||
          frequency = cfg.i2c1.frequency;
 | 
			
		||||
          inherit (cfg.i2c1) frequency;
 | 
			
		||||
        }) ];
 | 
			
		||||
      };
 | 
			
		||||
    })
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
{ config, lib, pkgs, ... }:
 | 
			
		||||
{ config, lib, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.hardware.raspberry-pi."4".fkms-3d;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
{ config, lib, pkgs, modulesPath, ... }:
 | 
			
		||||
{ config, lib, ... }:
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.hardware.raspberry-pi."4".apply-overlays-dtmerge;
 | 
			
		||||
  dt_ao_overlay = (final: prev: {
 | 
			
		||||
    deviceTree.applyOverlays = (prev.callPackage ./apply-overlays-dtmerge.nix { });
 | 
			
		||||
  });
 | 
			
		||||
  dt_ao_overlay = _final: prev: {
 | 
			
		||||
    deviceTree.applyOverlays = prev.callPackage ./apply-overlays-dtmerge.nix { };
 | 
			
		||||
  };
 | 
			
		||||
in {
 | 
			
		||||
  options.hardware = {
 | 
			
		||||
    raspberry-pi."4".apply-overlays-dtmerge = {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
{ config, lib, pkgs, ... }:
 | 
			
		||||
{ config, lib, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.hardware.raspberry-pi."4".poe-hat;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
{ config, lib, pkgs, ... }:
 | 
			
		||||
{ config, lib, ... }:
 | 
			
		||||
 | 
			
		||||
let 
 | 
			
		||||
  cfg = config.hardware.raspberry-pi."4".poe-plus-hat;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
{ config, lib, pkgs, ... }:
 | 
			
		||||
{ config, lib, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  cfg = config.hardware.raspberry-pi."4".pwm0;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user