style: format (alejandra)
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "unpack" ''
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
# Determine the Git repository root or default to current directory
|
||||
GIT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo .)"
|
||||
|
||||
|
||||
SILENT=false
|
||||
AUTO_YES=false
|
||||
ZIPFILE=
|
||||
@@ -16,7 +15,7 @@ pkgs.writeShellScriptBin "unpack" ''
|
||||
|
||||
# Check if the user is inside the 'web' directory or any of its subdirectories
|
||||
RELATIVE_PATH="$(realpath --relative-to="$GIT_ROOT" "$ORIGINAL_DIR")"
|
||||
|
||||
|
||||
IN_WEB=false
|
||||
if [ "$RELATIVE_PATH" = "web" ] || echo "$RELATIVE_PATH" | grep -qE '^web(/|$)'; then
|
||||
IN_WEB=true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "colorize" ''
|
||||
awk '
|
||||
BEGIN {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# FIXME: very unstable (on every request opens pager) but works somehow
|
||||
{ pkgs, ... }:
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "gh-tl" ''
|
||||
set -euo pipefail
|
||||
|
||||
@@ -54,7 +54,7 @@ pkgs.writeShellScriptBin "gh-tl" ''
|
||||
|
||||
# Fetch all labels from the source repository with pagination
|
||||
echo "Fetching labels from $SOURCE_REPO..."
|
||||
|
||||
|
||||
LABELS_JSON=$(gh api -H "Accept: application/vnd.github.v3+json" \
|
||||
/repos/"$SOURCE_REPO"/labels --paginate | jq -s 'add')
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "migration-name" ''
|
||||
curl --silent https://raw.githubusercontent.com/dwyl/english-words/master/words.txt | shuf -n2 | tr '\n' '_' | sed 's/_$//'
|
||||
curl --silent https://raw.githubusercontent.com/dwyl/english-words/master/words.txt | shuf -n2 | tr '\n' '_' | sed 's/_$//'
|
||||
''
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
# necessary to load every time .nvimrc
|
||||
# makes some magic to shading nvim but still uses nvim that shaded
|
||||
{ pkgs, ... }:
|
||||
# makes some magic to shading nvim but still uses nvim that shaded
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "nvim" ''
|
||||
# Source .env file
|
||||
if [ -f .env ]; then
|
||||
set -a
|
||||
. .env
|
||||
set +a
|
||||
fi
|
||||
# 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
|
||||
# Get the directory of this script
|
||||
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||
|
||||
# Execute the system's nvim with your custom arguments
|
||||
exec "$SYSTEM_NVIM" --cmd 'lua vim.o.exrc = true' "$@"
|
||||
# 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' "$@"
|
||||
''
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{ pkgs, ... }:
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "pager" ''
|
||||
nvim -R --clean -c 'set buftype=nofile' -c 'nnoremap q :q!<CR>' -c 'set nowrap' \
|
||||
-c 'set runtimepath^=${pkgs.vimPlugins.vim-plugin-AnsiEsc}' \
|
||||
-c 'runtime! plugin/*.vim' -c 'AnsiEsc' -
|
||||
# ^^^^^^^^^^^^^^^^^^^^
|
||||
# Prevents Neovim from treating the buffer as a file
|
||||
# ^^^^^^^^^^^^^^^^^^^^
|
||||
# Makes 'q' quit Neovim immediately
|
||||
# ^^^^^^^^^^^
|
||||
# Disables text wrapping
|
||||
# ^^^^^^^^
|
||||
# Enables ANSI color interpretation
|
||||
nvim -R --clean -c 'set buftype=nofile' -c 'nnoremap q :q!<CR>' -c 'set nowrap' \
|
||||
-c 'set runtimepath^=${pkgs.vimPlugins.vim-plugin-AnsiEsc}' \
|
||||
-c 'runtime! plugin/*.vim' -c 'AnsiEsc' -
|
||||
# ^^^^^^^^^^^^^^^^^^^^
|
||||
# Prevents Neovim from treating the buffer as a file
|
||||
# ^^^^^^^^^^^^^^^^^^^^
|
||||
# Makes 'q' quit Neovim immediately
|
||||
# ^^^^^^^^^^^
|
||||
# Disables text wrapping
|
||||
# ^^^^^^^^
|
||||
# Enables ANSI color interpretation
|
||||
''
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
{ cargoToml, nativeBuildInputs, pkgs, ... }:
|
||||
let
|
||||
{
|
||||
cargoToml,
|
||||
nativeBuildInputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
src = ./.;
|
||||
cargo = cargoToml src;
|
||||
in
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
pname = cargo.package.name;
|
||||
version = cargo.package.version;
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
pname = cargo.package.name;
|
||||
version = cargo.package.version;
|
||||
|
||||
inherit nativeBuildInputs src;
|
||||
inherit nativeBuildInputs src;
|
||||
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
doCheck = true;
|
||||
}
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
doCheck = true;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
{ cargoToml, nativeBuildInputs, pkgs, ... }:
|
||||
let
|
||||
{
|
||||
cargoToml,
|
||||
nativeBuildInputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
src = ./.;
|
||||
cargo = cargoToml src;
|
||||
in
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
pname = cargo.package.name;
|
||||
version = cargo.package.version;
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
pname = cargo.package.name;
|
||||
version = cargo.package.version;
|
||||
|
||||
inherit nativeBuildInputs src;
|
||||
inherit nativeBuildInputs src;
|
||||
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
doCheck = true;
|
||||
}
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
doCheck = true;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
{ cargoToml, nativeBuildInputs, pkgs, ... }:
|
||||
let
|
||||
{
|
||||
cargoToml,
|
||||
nativeBuildInputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
src = ./.;
|
||||
cargo = cargoToml src;
|
||||
in
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
pname = cargo.package.name;
|
||||
version = cargo.package.version;
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
pname = cargo.package.name;
|
||||
version = cargo.package.version;
|
||||
|
||||
inherit nativeBuildInputs src;
|
||||
inherit nativeBuildInputs src;
|
||||
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
doCheck = true;
|
||||
}
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
doCheck = true;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
{pkgs, ...}: let
|
||||
name = "printobstacle";
|
||||
in
|
||||
pkgs.writeShellScriptBin "${name}" ''
|
||||
printf "%s%s%s\n" "''${RED}" "$*" "''${RESET}"
|
||||
''
|
||||
in
|
||||
pkgs.writeShellScriptBin "${name}" ''
|
||||
printf "%s%s%s\n" "''${RED}" "$*" "''${RESET}"
|
||||
''
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
{pkgs, ...}: let
|
||||
name = "printprogress";
|
||||
in
|
||||
pkgs.writeShellScriptBin "${name}" ''
|
||||
printf "%s%s%s\n" "''${YELLOW}" "$*" "''${RESET}"
|
||||
''
|
||||
pkgs.writeShellScriptBin "${name}" ''
|
||||
printf "%s%s%s\n" "''${YELLOW}" "$*" "''${RESET}"
|
||||
''
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{ pkgs, ... }:
|
||||
{pkgs, ...}:
|
||||
pkgs.writeShellScriptBin "supabase" ''
|
||||
# Get the root of the repository
|
||||
GIT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo .)"
|
||||
# Get the root of the repository
|
||||
GIT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo .)"
|
||||
|
||||
# Source .env from root of the repo if it exists
|
||||
if [ -f "$GIT_ROOT/.env" ]; then
|
||||
set -a
|
||||
. "$GIT_ROOT/.env"
|
||||
set +a
|
||||
fi
|
||||
# Source .env from root of the repo if it exists
|
||||
if [ -f "$GIT_ROOT/.env" ]; then
|
||||
set -a
|
||||
. "$GIT_ROOT/.env"
|
||||
set +a
|
||||
fi
|
||||
|
||||
${pkgs.supabase-cli}/bin/supabase --workdir "$GIT_ROOT/web" $@
|
||||
${pkgs.supabase-cli}/bin/supabase --workdir "$GIT_ROOT/web" $@
|
||||
''
|
||||
|
||||
Reference in New Issue
Block a user