mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	Pick a better name than "versionsOfOption"
This commit is contained in:
		@@ -3,7 +3,7 @@
 | 
			
		||||
let
 | 
			
		||||
  inherit (lib) mkIf mkOption;
 | 
			
		||||
 | 
			
		||||
  inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage surfacePatches isVersionOf versionsOfOption;
 | 
			
		||||
  inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage surfacePatches isVersionOf versionsOfEnum;
 | 
			
		||||
 | 
			
		||||
  cfg = config.microsoft-surface;
 | 
			
		||||
 | 
			
		||||
@@ -20,7 +20,7 @@ let
 | 
			
		||||
 | 
			
		||||
in {
 | 
			
		||||
  options.microsoft-surface.kernelVersion = mkOption {
 | 
			
		||||
    type = versionsOfOption version;
 | 
			
		||||
    type = versionsOfEnum version;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  config = mkIf (isVersionOf cfg.kernelVersion version) {
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ let
 | 
			
		||||
    # Provides a list of versions that can be used as an enum option for this full version:
 | 
			
		||||
    [ version (versions.majorMinor version) ];
 | 
			
		||||
 | 
			
		||||
  versionsOfOption = version:
 | 
			
		||||
  versionsOfEnum = version:
 | 
			
		||||
    # Provide an enum option for versions of this kernel:
 | 
			
		||||
    types.enum (versionsOf version);
 | 
			
		||||
 | 
			
		||||
@@ -51,5 +51,5 @@ let
 | 
			
		||||
    elem version (versionsOf version);
 | 
			
		||||
 | 
			
		||||
in {
 | 
			
		||||
  inherit linuxPackage repos surfacePatches versionsOf isVersionOf versionsOfOption;
 | 
			
		||||
  inherit linuxPackage repos surfacePatches versionsOf isVersionOf versionsOfEnum;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user