mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-30 14:11:02 +01:00
This commit converts `package = mkOption` declarations throughout the
codebase to use the more modern and consistent `lib.mkPackageOption`
function.
Key changes:
- Simple package options: `mkOption { type = types.package; default = pkgs.foo; }`
becomes `lib.mkPackageOption pkgs "foo" { }`
- Package set options: Uses correct package set as first argument with
`pkgsText` parameter (e.g., `lib.mkPackageOption pkgs.vimPlugins "plugin" { pkgsText = "pkgs.vimPlugins"; }`)
- Removes redundant descriptions that just restate the package name
- Preserves examples and extra context where meaningful
- Handles submodule plugin options properly with `null` defaults
This modernizes the option declarations and makes them more consistent
with current nixpkgs patterns while maintaining full backward compatibility.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
63 lines
1.6 KiB
Nix
63 lines
1.6 KiB
Nix
{ lib, pkgs, ... }:
|
|
|
|
let
|
|
# Define the systemd service type
|
|
quadletInternalType = lib.types.submodule {
|
|
options = {
|
|
assertions = lib.mkOption {
|
|
type = with lib.types; listOf unspecified;
|
|
default = [ ];
|
|
internal = true;
|
|
description = "List of Nix type assertions.";
|
|
};
|
|
|
|
dependencies = lib.mkOption {
|
|
type = with lib.types; listOf package;
|
|
default = [ ];
|
|
internal = true;
|
|
description = "List of systemd service dependencies.";
|
|
};
|
|
|
|
resourceType = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "";
|
|
internal = true;
|
|
description = "The type of the podman Quadlet resource.";
|
|
};
|
|
|
|
serviceName = lib.mkOption {
|
|
type = lib.types.str;
|
|
internal = true;
|
|
description = "The name of the systemd service.";
|
|
};
|
|
|
|
source = lib.mkOption {
|
|
type = lib.types.str;
|
|
internal = true;
|
|
description = "The quadlet source file content.";
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
options.services.podman = {
|
|
internal = {
|
|
quadletDefinitions = lib.mkOption {
|
|
type = lib.types.listOf quadletInternalType;
|
|
default = { };
|
|
internal = true;
|
|
description = "List of quadlet source file content and service names.";
|
|
};
|
|
builtQuadlets = lib.mkOption {
|
|
type = with lib.types; attrsOf package;
|
|
default = { };
|
|
internal = true;
|
|
description = "All built quadlets.";
|
|
};
|
|
};
|
|
|
|
package = lib.mkPackageOption pkgs "podman" { };
|
|
|
|
enableTypeChecks = lib.mkEnableOption "type checks for podman quadlets";
|
|
};
|
|
}
|