mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	starfive visionfive2: allow uboot and opensbi patches overrides
This commit is contained in:
		
				
					committed by
					
						
						mergify[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							7eab0aa0b7
						
					
				
				
					commit
					3713545aca
				
			@@ -5,16 +5,30 @@ in
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  options = {
 | 
					  options = {
 | 
				
			||||||
    hardware.visionfive2 = {
 | 
					    hardware.visionfive2 = {
 | 
				
			||||||
      opensbi.src = lib.mkOption {
 | 
					      opensbi = {
 | 
				
			||||||
 | 
					        src = lib.mkOption {
 | 
				
			||||||
          description = "VisionFive2 OpenSBI source";
 | 
					          description = "VisionFive2 OpenSBI source";
 | 
				
			||||||
          type = lib.types.nullOr lib.types.package;
 | 
					          type = lib.types.nullOr lib.types.package;
 | 
				
			||||||
          default = null;
 | 
					          default = null;
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
      uboot.src = lib.mkOption {
 | 
					        patches = lib.mkOption {
 | 
				
			||||||
 | 
					          description = "List of patches to apply to the VisionFive2 OpenSBI source";
 | 
				
			||||||
 | 
					          type = lib.types.nullOr (lib.types.listOf lib.types.package);
 | 
				
			||||||
 | 
					          default = null;
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      uboot = {
 | 
				
			||||||
 | 
					        src = lib.mkOption {
 | 
				
			||||||
          description = "VisionFive2 U-boot source";
 | 
					          description = "VisionFive2 U-boot source";
 | 
				
			||||||
          type = lib.types.nullOr lib.types.package;
 | 
					          type = lib.types.nullOr lib.types.package;
 | 
				
			||||||
          default = null;
 | 
					          default = null;
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					        patches = lib.mkOption {
 | 
				
			||||||
 | 
					          description = "List of patches to apply to the VisionFive2 U-boot source";
 | 
				
			||||||
 | 
					          type = lib.types.nullOr (lib.types.listOf lib.types.package);
 | 
				
			||||||
 | 
					          default = null;
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -22,10 +36,12 @@ in
 | 
				
			|||||||
    system.build = {
 | 
					    system.build = {
 | 
				
			||||||
      opensbi = (pkgs.callPackage ./opensbi.nix {}).overrideAttrs (f: p: {
 | 
					      opensbi = (pkgs.callPackage ./opensbi.nix {}).overrideAttrs (f: p: {
 | 
				
			||||||
        src = if cfg.opensbi.src != null then cfg.opensbi.src else p.src;
 | 
					        src = if cfg.opensbi.src != null then cfg.opensbi.src else p.src;
 | 
				
			||||||
 | 
					        patches = if cfg.opensbi.patches != null then cfg.opensbi.patches else (p.patches or []);
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      uboot = (pkgs.callPackage ./uboot.nix { inherit (config.system.build) opensbi; }).overrideAttrs (f: p: {
 | 
					      uboot = (pkgs.callPackage ./uboot.nix { inherit (config.system.build) opensbi; }).overrideAttrs (f: p: {
 | 
				
			||||||
        src = if cfg.uboot.src != null then cfg.uboot.src else p.src;
 | 
					        src = if cfg.uboot.src != null then cfg.uboot.src else p.src;
 | 
				
			||||||
 | 
					        patches = if cfg.uboot.patches != null then cfg.uboot.patches else (p.patches or []);
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      updater-flash = pkgs.writeShellApplication {
 | 
					      updater-flash = pkgs.writeShellApplication {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user