1
0
mirror of https://github.com/pinpox/gitea-matrix-bot synced 2024-11-26 08:43:47 +01:00
gitea-matrix-bot/flake.nix
Pablo Ovelleiro Corral 740048e8cf
Fix and flakify
2023-07-13 15:42:23 +02:00

57 lines
1.6 KiB
Nix

{
description = "A bot to post gitea events to a matrix channel";
# Nixpkgs / NixOS version to use.
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
# System types to support.
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
});
in
{
# A Nixpkgs overlay.
overlays.default = final: prev: {
gitea-matrix-bot = with final;
buildGoModule {
pname = "gitea-matrix-bot";
version = "master";
src = ./.;
vendorSha256 =
"sha256-Kce1ky4orC8pPSEUAbOeW/O2S4ThtOLdYIPaXfKGHA4=";
# TODO fix tests
doCheck = false;
meta = with lib; {
description = "A bot to post gitea events to a matrix channel";
homepage = "https://github.com/pinpox/gitea-matrix-bot";
license = licenses.gpl3;
maintainers = with maintainers; [ pinpox ];
};
};
};
# Package
packages = forAllSystems (system: {
inherit (nixpkgsFor.${system}) gitea-matrix-bot;
default = self.packages.${system}.gitea-matrix-bot;
});
# TODO: Add module
};
}