Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 45 lines 1.5 kB view raw
1{ lib, config, ... }: 2let 3 inherit (config.generic.types) majorMinorVersion majorMinorPatchBuildVersion; 4 inherit (lib) options types; 5in 6{ 7 options.generic.releases = options.mkOption { 8 description = "Collection of packages targeting different platforms"; 9 type = 10 let 11 Package = options.mkOption { 12 description = "Package for a specific platform"; 13 example = { 14 version = "8.0.3.4"; 15 minCudaVersion = "10.2"; 16 maxCudaVersion = "10.2"; 17 hash = "sha256-LxcXgwe1OCRfwDsEsNLIkeNsOcx3KuF5Sj+g2dY6WD0="; 18 }; 19 type = types.submodule { 20 # TODO(@connorbaker): Figure out how to extend option sets. 21 freeformType = types.attrsOf types.anything; 22 options = { 23 version = options.mkOption { 24 description = "Version of the package"; 25 type = majorMinorPatchBuildVersion; 26 }; 27 minCudaVersion = options.mkOption { 28 description = "Minimum CUDA version supported"; 29 type = majorMinorVersion; 30 }; 31 maxCudaVersion = options.mkOption { 32 description = "Maximum CUDA version supported"; 33 type = majorMinorVersion; 34 }; 35 hash = options.mkOption { 36 description = "Hash of the tarball"; 37 type = types.str; 38 }; 39 }; 40 }; 41 }; 42 in 43 types.attrsOf (types.listOf Package.type); 44 }; 45}