feat: labeles transfer for github repositories

This commit is contained in:
2025-01-31 00:44:58 +00:00
parent 7890362285
commit 404e6a05ed
7 changed files with 191 additions and 80 deletions

View File

@@ -45,90 +45,25 @@
forAllSystemsWithPkgs [] ({ system, pkgs }:
{
packages.${system} = {
# necessary to load every time .nvimrc
# makes some magic to shading nvim but still uses nvim that shaded
nvim-alias = pkgs.writeShellScriptBin "nvim" ''
# Source .env file
if [ -f .env ]; then
set -a
. .env
set +a
fi
# Get the directory of this script
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
# Remove the script's directory from PATH to avoid recursion
PATH=$(echo "$PATH" | tr ':' '\n' | grep -v "$SCRIPT_DIR" | paste -sd ':' -)
# Find the system's nvim
SYSTEM_NVIM=$(command -v nvim)
if [ -z "$SYSTEM_NVIM" ]; then
echo "Error: nvim not found in PATH" >&2
exit 1
fi
# Execute the system's nvim with your custom arguments
exec "$SYSTEM_NVIM" --cmd 'lua vim.o.exrc = true' "$@"
'';
printobstacle =
let
name = "printobstacle";
in
pkgs.writeShellScriptBin "${name}" ''
printf "%s%s%s\n" "''${RED}" "$*" "''${RESET}"
'';
printprogress =
let
name = "printprogress";
in
pkgs.writeShellScriptBin "${name}" ''
printf "%s%s%s\n" "''${YELLOW}" "$*" "''${RESET}"
'';
colorize = pkgs.writeShellScriptBin "colorize" ''
awk '
BEGIN {
# Define color codes
RED = "\x1b[31m";
BLUE = "\x1b[34m";
GREEN = "\x1b[32m";
YELLOW = "\x1b[33m";
MAGENTA = "\x1b[35m";
CYAN = "\x1b[36m";
RESET = "\x1b[0m";
}
{
# Apply color based on keywords
gsub(/ERROR:/, RED "&" RESET, $0);
gsub(/DEBUG:/, BLUE "&" RESET, $0);
gsub(/INFO:/, GREEN "&" RESET, $0);
gsub(/LOG:/, GREEN "&" RESET, $0);
gsub(/EXCEPTION:/, MAGENTA "&" RESET, $0);
gsub(/WARNING:/, YELLOW "&" RESET, $0);
gsub(/NOTICE:/, CYAN "&" RESET, $0);
gsub(/HINT:/, CYAN "&" RESET, $0);
gsub(/FATAL:/, MAGENTA "&" RESET, $0);
gsub(/DETAIL:/, CYAN "&" RESET, $0);
gsub(/STATEMENT:/, CYAN "&" RESET, $0);
print;
}
'
'';
nvim-alias = pkgs.callPackage ./package/nvim-alias.nix {};
printobstacle = pkgs.callPackage ./package/printobstacle.nix {};
printprogress = pkgs.callPackage ./package/printprogress.nix {};
colorize = pkgs.callPackage ./package/colorize.nix {};
gh_translabeles = pkgs.callPackage ./package/github/gh_translabeles.nix {};
};
nixosModules.${system} = {
"hetzner.hardware" = {
boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"xen_blkfront"
"vmw_pvscsi"
];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
};
boot.loader.grub.device = "/dev/sda";
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"xen_blkfront"
"vmw_pvscsi"
];
boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
};
};
}) // {
lib = {