"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractPackageFile = extractPackageFile;
const regex_1 = require("../../../util/regex");
const git_refs_1 = require("../../datasource/git-refs");
const nixpkgs_1 = require("../../versioning/nixpkgs");
const nixpkgsRegex = (0, regex_1.regEx)(/"github:nixos\/nixpkgs(\/(?<ref>[a-z0-9-.]+))?"/i);
function extractPackageFile(content) {
    const deps = [];
    const match = nixpkgsRegex.exec(content);
    if (match?.groups) {
        const { ref } = match.groups;
        deps.push({
            depName: 'nixpkgs',
            currentValue: ref,
            datasource: git_refs_1.GitRefsDatasource.id,
            packageName: 'https://github.com/NixOS/nixpkgs',
            versioning: nixpkgs_1.id,
        });
    }
    if (deps.length) {
        return { deps };
    }
    return null;
}
//# sourceMappingURL=extract.js.map