appstream-generator icon indicating copy to clipboard operation
appstream-generator copied to clipboard

nix backend: init

Open vlinkz opened this issue 6 months ago • 2 comments

Nix has a very different way of using and storing packages, so to make everything work as expected I lie and pretend we have /usr/ even though the $datadir in a nix package is in /nix/store/hash-pkg-version/share (at runtime XDG_DATA_DIRS is set to /run/current-system/sw/share:/nix/store/hash-pkg-version/share:/nix/store/hash-pkg2-version/share etc ).

Waiting for https://github.com/NixOS/nixpkgs/pull/411205 (release tracker) to remove src/asgen/backends/nix/nixpkg.d L144-149

Example asgen-config.json

{
  "ProjectName": "Nix",
  "ArchiveRoot": "https://cache.nixos.org/",
  "Backend": "nix",
  "Features": {
    "processDesktop": true,
    "validateMetainfo": true,
    "createScreenshotsStore": false,
    "noDownloads": true
  },
  "Suites": {
    "nixpkgs": {
      "sections": ["nixos-unstable"],
      "architectures": ["x86_64-linux"]
    }
  }
}

vlinkz avatar May 27 '25 08:05 vlinkz

This is fine :-) Nix is pretty much an outlier compared to the other package-management systems, but if you manage to get something working that people would want to use, there'd be no reason not to merge it.

Also, for FreeBSD we'll likely add support for extra data search paths soon, which may also help you.

ximion avatar Sep 08 '25 20:09 ximion

Also, for FreeBSD we'll likely add support for extra data search paths soon, which may also help you.

That support has been added, check out PackageIndex::dataPrefix() :-)

ximion avatar Nov 01 '25 00:11 ximion