2 Manages the flake registry.
27 type = types.attrsOf (
40 { config, name, ... }:
44 type = referenceAttrs;
49 description = "The flake reference to be rewritten.";
52 type = referenceAttrs;
58 description = "The flake reference {option}`from` is rewritten to.";
61 type = types.nullOr types.attrs;
63 example = literalExpression "nixpkgs";
65 The flake input {option}`from` is rewritten to.
72 Whether the {option}`from` reference needs to match exactly. If set,
73 a {option}`from` reference like `nixpkgs` does not
74 match with a reference like `nixpkgs/nixos-20.03`.
83 to = mkIf (config.flake != null) (
87 path = config.flake.outPath;
89 // filterAttrs (n: _: n == "lastModified" || n == "rev" || n == "narHash") config.flake
98 A system-wide flake registry.
104 config = mkIf cfg.enable {
105 environment.etc."nix/registry.json".text = builtins.toJSON {
107 flakes = mapAttrsToList (n: v: { inherit (v) from to exact; }) cfg.registry;