Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 43 additions & 20 deletions pkgs/pkgs-lib/formats.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
{ lib, pkgs }:
rec {
let
inherit (lib.types)
attrsOf
bool
coercedTo
either
float
int
listOf
luaInline
mkOptionType
nonEmptyListOf
nullOr
oneOf
path
str
;

# Attributes added accidentally in https://github.com/NixOS/nixpkgs/pull/335232 (2024-08-18)
# Deprecated in https://github.com/NixOS/nixpkgs/pull/415666 (2025-06)
aliases =
lib.mapAttrs (name: lib.warn "`formats.${name}` is deprecated; use `lib.types.${name}` instead.")
{
inherit
attrsOf
bool
coercedTo
either
float
int
listOf
luaInline
mkOptionType
nonEmptyListOf
nullOr
oneOf
path
str
;
};
in
lib.optionalAttrs pkgs.config.allowAliases aliases
Comment thread
philiptaron marked this conversation as resolved.
Outdated
// rec {

/*
Every following entry represents a format for program configuration files
Expand Down Expand Up @@ -43,25 +85,6 @@ rec {

php = (import ./formats/php/default.nix { inherit lib pkgs; }).format;

inherit (lib) mkOptionType;
inherit (lib.types)
nullOr
oneOf
coercedTo
listOf
nonEmptyListOf
attrsOf
either
;
inherit (lib.types)
bool
int
float
str
path
luaInline
;

json =
{ }:
{
Expand Down