{"id":16956503,"url":"https://github.com/bgamari/nix-pkgconfig","last_synced_at":"2025-08-03T21:33:52.117Z","repository":{"id":66202376,"uuid":"156768893","full_name":"bgamari/nix-pkgconfig","owner":"bgamari","description":"A pkg-config wrapper exposing nixpkgs packages","archived":false,"fork":false,"pushed_at":"2021-11-27T03:04:46.000Z","size":24,"stargazers_count":26,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-31T12:33:18.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgamari.png","metadata":{"files":{"readme":"README.mkd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-08T21:06:24.000Z","updated_at":"2025-03-18T21:49:02.000Z","dependencies_parsed_at":"2023-03-01T09:16:03.270Z","dependency_job_id":null,"html_url":"https://github.com/bgamari/nix-pkgconfig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bgamari/nix-pkgconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgamari%2Fnix-pkgconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgamari%2Fnix-pkgconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgamari%2Fnix-pkgconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgamari%2Fnix-pkgconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgamari","download_url":"https://codeload.github.com/bgamari/nix-pkgconfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgamari%2Fnix-pkgconfig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268617308,"owners_count":24279230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T22:15:12.721Z","updated_at":"2025-08-03T21:33:52.102Z","avatar_url":"https://github.com/bgamari.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nix-pkgconfig\n\n`nix-pkgconfig` is a wrapper for `pkg-config` allowing nix-unaware applications (e.g.\n`cabal-install`) to use packages from `nixpkgs` (to satisfy native library\ndependencies).\n\n\n## Getting started\n\n`nix-pkgconfig` relies on a database of mappings between `pkg-config` `.pc`\nfiles and the `nixpkgs` attribute they are provided by. A minimal example\ndatabase (`default-database.json`) is included which can be installed via:\n\n```\n$ mkdir -p $XDG_CONFIG_HOME/nix-pkgconfig\n$ cp default-database.json $XDG_CONFIG_HOME/nix-pkgconfig/001-default.json\n```\n\nHowever, it is recommended that you build a more complete database covering\nnearly all of `nixpkgs`. This can be built using the `build-database.sh` script:\n\n```\n$ ./build-database.sh\n```\n\nA `nix` derivation is provided through `default.nix` which creates a wrapper\nfor the `pkg-config` script, enabling convenient use on NixOS:\n\n```\n$ nix build -f . --no-link\n$ PATH=$(nix eval --raw -f ./default.nix outPath)/bin:$PATH\n```\n\nWhen called the `pkg-config` wrapper will consult the database looking for the\n`nix` derivation providing each requested package, build it, and run the\nrequested `pkg-config` invocation. For instance, we can run:\n\n```\n$ pkg-config --cflags libpq\n-I/nix/store/53kwps1ndh29wgjjwa7qf06ygvjxfs09-postgresql-9.6.11/include\n```\n\n\n## Usage with cabal-install\n\nTo use this with `cabal-install` you may either place `pkg-config` in `PATH` as\ndescribed above or explicitly point `cabal` at the `pkg-config` script:\n\n```\ncabal new-build --with-pkg-config=$PATH_TO_THIS_REPO/pkg-config\n```\n\nAlternatively, you might consider either adding `nix-pkgconfig` to\n`environment.systemPackages` or your account's mutable environment (e.g.\n`nix-env -i -f .`).\n\nNote that some packages respect the `pkg-config` flag to enable\n`pkg-config`-based native library discovery.  The included\n`cabal.project.local` includes some `project` stanzas to enable the necessary\nflags with cabal `new-build`. Copy these into your project's\n`cabal.project.local` if you intend on using `nix-pkgconfig`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgamari%2Fnix-pkgconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgamari%2Fnix-pkgconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgamari%2Fnix-pkgconfig/lists"}