{"id":26009886,"url":"https://github.com/frobware/nix-openshift-haproxy","last_synced_at":"2025-03-05T22:26:06.609Z","repository":{"id":228050817,"uuid":"773030784","full_name":"frobware/nix-openshift-haproxy","owner":"frobware","description":"A Nix flake offering various versions of HAProxy, built in the style of OpenShift Ingress.","archived":false,"fork":false,"pushed_at":"2024-12-12T08:51:33.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T07:38:25.777Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","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/frobware.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2024-03-16T14:54:44.000Z","updated_at":"2025-01-28T11:13:07.000Z","dependencies_parsed_at":"2024-03-16T18:27:21.022Z","dependency_job_id":"f6a0622d-3d1e-4c7e-a4af-2d2f8b0ef693","html_url":"https://github.com/frobware/nix-openshift-haproxy","commit_stats":null,"previous_names":["frobware/openshift-haproxy","frobware/nix-openshift-haproxy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fnix-openshift-haproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fnix-openshift-haproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fnix-openshift-haproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fnix-openshift-haproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frobware","download_url":"https://codeload.github.com/frobware/nix-openshift-haproxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242112669,"owners_count":20073647,"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","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":"2025-03-05T22:26:05.867Z","updated_at":"2025-03-05T22:26:06.600Z","avatar_url":"https://github.com/frobware.png","language":"Nix","readme":"# OCP-HAProxy Flake for Nix\n\nThis flake offers various versions of HAProxy, built in the style of OpenShift Ingress. It's designed to be imported into other Nix configurations and provides support for multiple HAProxy versions, each with standard and debug builds.\n\n## Key Features\n\n- **Multiple HAProxy Versions**: Supports various versions of HAProxy, each identified by a unique hash and optional patches.\n- **Standard and Debug Builds**: For each HAProxy version, there are two builds - a standard build (`buildHAProxy`) and a debug build (`buildHAProxyDebug`).\n- **Flexibility for Different Systems**: Builds are available for multiple systems, specifically `aarch64-linux` and `x86_64-linux`.\n- **Default Package and DevShell Support**: Includes a default package configuration for ease of use and a development shell environment for development and testing.\n\n## Flake Configuration\n\n- **Inputs**: Uses Nixpkgs from the `nixos-unstable` branch.\n- **Outputs**: Defines packages, overlays, a default package for each supported system, and development shells.\n\n## Packages Definition (`packages.nix`)\n\n- Specifies multiple versions of HAProxy, each with its own hash and optional patches.\n- For each version, it generates two Nix attributes: one for the standard build and another for the debug build.\n- Uses a custom builder (`package.nix`) to define the build process for HAProxy.\n\n## Usage in Nix Configurations\n\nTo use this flake in another Nix configuration, add it as an input to your `flake.nix` and reference the packages or overlays as needed.\n\n```nix\n{\n  inputs = {\n    nixpkgs.url = \"github:NixOS/nixpkgs/nixos-23.11\";\n    ocp-haproxy.url = \"github:frobware/openshift-dev?dir=haproxy\";\n  };\n\n  outputs = { self, nixpkgs, ocp-haproxy, ... }: {\n    nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem {\n      system = \"x86_64-linux\";\n      modules = [\n        ({ pkgs, ... }: {\n          # Use the default HAProxy package from the flake.\n          environment.systemPackages = with pkgs; [\n            ocp-haproxy.defaultPackage.x86_64-linux\n          ];\n\n          # Additional configuration options go here...\n        })\n      ];\n    };\n  };\n}\n```\n\n## Accessing Packages and Overlays\n\n- Access specific HAProxy builds directly via the package set, e.g., `ocp_haproxy_2_8_5`.\n- Utilize overlays to integrate the package set with your Nixpkgs.\n\n## Default Packages\n\nEach supported system (`aarch64-linux`, `x86_64-linux`) has a default package set, making it easier to use the flake in various environments.\n\n## Development Shells\n\nDevelopment shells are available for supported systems, providing a clean environment for development and testing.\n\n## OCP-HAProxy Nix Package\n\n### Install Phase\n\nThe `installPhase` handles multiple aspects of setting up HAProxy for different versions:\n\n1. **Directory Structure Creation**: Creates necessary directories for binaries and source files specific to each version of HAProxy.\n2. **Binary Installation**: Installs the HAProxy binary with a version-specific name (`ocp-haproxy-${version}-g`) in the `bin` directory.\n3. **Source Code Management**: Extracts the source code for each version into a version-specific directory under `share`.\n4. **GDB Initialization File**: Creates a `gdbinit` file for each version, specifying the directory of the source code, facilitating debugging with GDB.\n5. **GDB Wrapper Script**: Generates a wrapper script for GDB for each version. This script invokes GDB with the corresponding `gdbinit` file.\n6. **Clangd Configuration**: Uses Perl to generate `.clangd` configuration files for each version, ensuring proper settings for Clangd, including the inclusion of version-specific headers.\n7. **Compile Commands JSON**: Installs the `compile_commands.json` file in the appropriate source directory for each version, aiding in source code analysis and other tooling.\n8. **Emacs Project Recognition**: Adds a sentinel file (.project) in each version-specific directory, allowing Emacs' project.el to recognize these directories as individual projects. This is particularly useful when the directories are not part of a version control system and assists developers in using Emacs tooling effectively with each HAProxy version.\n\nThis setup ensures that each version of HAProxy is isolated and configured with its appropriate debugging and development tools.\n\n## Customising and Extending\n\nYou can extend or customise this flake by:\n\n- Adding new HAProxy versions or patches in `packages.nix`.\n- Modifying the build process in `package.nix`.\n- Adjusting the systems supported or the default packages.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Fnix-openshift-haproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrobware%2Fnix-openshift-haproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Fnix-openshift-haproxy/lists"}