2023-05-20 16:23:41 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
let
|
|
|
|
pkgs.hello = {
|
|
|
|
type = "derivation";
|
|
|
|
pname = "hello";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
package = lib.mkPackageOption pkgs "hello" { };
|
|
|
|
|
2023-10-06 11:28:46 +00:00
|
|
|
namedPackage = lib.mkPackageOption pkgs "Hello" {
|
|
|
|
default = [ "hello" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
namedPackageSingletonDefault = lib.mkPackageOption pkgs "Hello" {
|
|
|
|
default = "hello";
|
|
|
|
};
|
|
|
|
|
|
|
|
pathPackage = lib.mkPackageOption pkgs [ "hello" ] { };
|
|
|
|
|
|
|
|
packageWithExample = lib.mkPackageOption pkgs "hello" {
|
|
|
|
example = "pkgs.hello.override { stdenv = pkgs.clangStdenv; }";
|
|
|
|
};
|
|
|
|
|
|
|
|
packageWithPathExample = lib.mkPackageOption pkgs "hello" {
|
|
|
|
example = [ "hello" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
packageWithExtraDescription = lib.mkPackageOption pkgs "hello" {
|
|
|
|
extraDescription = "Example extra description.";
|
|
|
|
};
|
|
|
|
|
2023-05-20 16:23:41 +00:00
|
|
|
undefinedPackage = lib.mkPackageOption pkgs "hello" {
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
|
|
|
|
nullablePackage = lib.mkPackageOption pkgs "hello" {
|
|
|
|
nullable = true;
|
|
|
|
default = null;
|
|
|
|
};
|
2023-10-06 11:28:46 +00:00
|
|
|
|
|
|
|
nullablePackageWithDefault = lib.mkPackageOption pkgs "hello" {
|
|
|
|
nullable = true;
|
|
|
|
};
|
2023-10-06 11:32:49 +00:00
|
|
|
|
|
|
|
packageWithPkgsText = lib.mkPackageOption pkgs "hello" {
|
|
|
|
pkgsText = "myPkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
packageFromOtherSet =
|
|
|
|
let
|
|
|
|
myPkgs = {
|
|
|
|
hello = pkgs.hello // {
|
|
|
|
pname = "hello-other";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
lib.mkPackageOption myPkgs "hello" { };
|
2023-05-20 16:23:41 +00:00
|
|
|
};
|
|
|
|
}
|