Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package request: repology #312744

Open
panicgh opened this issue May 18, 2024 · 1 comment
Open

Package request: repology #312744

panicgh opened this issue May 18, 2024 · 1 comment

Comments

@panicgh
Copy link
Contributor

panicgh commented May 18, 2024

Project description

Repology is a packaging hub, providing users with comparisons of statistics of packages. For example, which pkgs are available in which versions and repositories.

I would find it interesting to run my own instance of repology, scraping e.g. company internal (RPM, DEB) repositories, GitLab for new version tags etc. This would allow for easy comparison of available packages and versions. For example the organization may run its own customized Linux distro (e.g. spun-off Debian; using regular snapshots of upstream repos) with branches for the integration of internal software (e.g. stable, testing/development versions of the distro).

This would need packaging of the software components of repology as well as NixOS modules.

Metadata


Add a 👍 reaction to issues you find important.

@jopejoe1
Copy link
Member

I created a basic flake for repology for dev testing, could probably be of help while creating a package in nixpkgs

{
  description = "Build Repology with nix";

  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";
  inputs.repology-webapp = {
    url = "github:repology/repology-webapp";
    flake = false;
  };
  inputs.repology-updater = {
    url = "github:repology/repology-updater";
    flake = false;
  };
  inputs.repology-rules = {
    url = "github:repology/repology-rules";
    flake = false;
  };
  inputs.repology-linkchecker = {
    url = "github:repology/repology-linkchecker";
    flake = false;
  };

  outputs = { self, nixpkgs, flake-utils, repology-rules, repology-updater, repology-webapp, repology-linkchecker }:
    flake-utils.lib.eachDefaultSystem (system:
      let

        pkgs = import nixpkgs { inherit system; };
      in rec {
        packages = flake-utils.lib.flattenTree {
          update = pkgs.stdenv.mkDerivation {
            pname = "repology-updater";
            version = "unstable-2023-12-11";

            src = repology-updater;

            propagatedBuildInputs = with pkgs; [
              (python3.withPackages
                (python3Packages: with python3Packages; [
                  jinja2
                  libversion
                  psycopg2
                  pyyaml
                  xxhash
                  pydantic
                  jsonslicer
                  lxml
                  protobuf
                  pyparsing
                  requests
                  rpm
                  rubymarshal
                  tomli
                  yarl
                  zstandard
                  brotli
                ])
              )
              git
              subversion
              rsync
            ];
            dontUnpack = true;
            installPhase = ''
              runHook preInstall

              mkdir -p $out/
              cp -r $src/* $out/
              cp $out/repology.conf.default $out/repology.conf
              substituteInPlace $out/repology.conf \
                --replace "repos.d" "$out/repos.d" \
                --replace "sql.d" "$out/sql.d" \
                --replace "rules.d" "${repology-rules}" \
                --replace "repology.org" "test.local" \
                --replace "_state" "/home/jopejoe1/dev/repology/_state" \
                --replace "_parsed" "/home/jopejoe1/dev/repology/_parsed" \
                --replace "production" "nix" \
                --replace "None" "'/home/jopejoe1/.cache/repology/'"

              runHook postInstall
            '';
          };
          web = pkgs.stdenv.mkDerivation {
            pname = "repology-webapp";
            version = "unstable-2023-12-11";

            src = "${repology-webapp}";

            propagatedBuildInputs = with pkgs; [
              (python3.withPackages
                (python3Packages: with python3Packages; [
                  flask
                  libversion
                  pillow
                  psycopg2
                ])
              )
            ];
            dontUnpack = true;
            installPhase = ''
              runHook preInstall

              mkdir -p $out/
              cp -r $src/* $out/
              cp $out/repology.conf.default $out/repology.conf
              substituteInPlace $out/repology.conf \
                --replace "sql.d" "$out/sql.d" \
                --replace "#SECRET_KEY = ${"''"}" "SECRET_KEY = '192b9bdd22ba9ed4d12e236c43afcb9a393ec15f71bbf5dc987d54727823bcbf'" \
                --replace "https://repology.org" "http://127.0.0.1:5000"

              runHook postInstall
            '';
          };
        };
        defaultPackage = packages.update;
        apps = {
          update = flake-utils.lib.mkApp {
            drv = packages.update;
            exePath = "/repology-update.py";
          };
          web = flake-utils.lib.mkApp {
            drv = packages.web;
            exePath = "/repology-app.py";
          };
        };
        defaultApp = apps.update;
      });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants