feat: jenkins + darwin (and linting)

This commit is contained in:
Swarsel 2024-10-22 18:10:34 +02:00
parent d2c8805e5b
commit 6338497d5f
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
42 changed files with 841 additions and 602 deletions

View file

@ -1,36 +1,37 @@
{ pkgs, config, ... }:
let
inherit (config.lib.stylix) colors;
sesh = pkgs.writeScriptBin "sesh" ''
#! /usr/bin/env sh
_:
# { pkgs, config, ... }:
# let
# inherit (config.lib.stylix) colors;
# sesh = pkgs.writeScriptBin "sesh" ''
# #! /usr/bin/env sh
# Taken from https://github.com/zellij-org/zellij/issues/884#issuecomment-1851136980
# select a directory using zoxide
ZOXIDE_RESULT=$(zoxide query --interactive)
# checks whether a directory has been selected
if [[ -z "$ZOXIDE_RESULT" ]]; then
# if there was no directory, select returns without executing
exit 0
fi
# extracts the directory name from the absolute path
SESSION_TITLE=$(echo "$ZOXIDE_RESULT" | sed 's#.*/##')
# # Taken from https://github.com/zellij-org/zellij/issues/884#issuecomment-1851136980
# # select a directory using zoxide
# ZOXIDE_RESULT=$(zoxide query --interactive)
# # checks whether a directory has been selected
# if [[ -z "$ZOXIDE_RESULT" ]]; then
# # if there was no directory, select returns without executing
# exit 0
# fi
# # extracts the directory name from the absolute path
# SESSION_TITLE=$(echo "$ZOXIDE_RESULT" | sed 's#.*/##')
# get the list of sessions
SESSION_LIST=$(zellij list-sessions -n | awk '{print $1}')
# # get the list of sessions
# SESSION_LIST=$(zellij list-sessions -n | awk '{print $1}')
# checks if SESSION_TITLE is in the session list
if echo "$SESSION_LIST" | grep -q "^$SESSION_TITLE$"; then
# if so, attach to existing session
zellij attach "$SESSION_TITLE"
else
# if not, create a new session
echo "Creating new session $SESSION_TITLE and CD $ZOXIDE_RESULT"
cd $ZOXIDE_RESULT
zellij attach -c "$SESSION_TITLE"
fi
'';
# # checks if SESSION_TITLE is in the session list
# if echo "$SESSION_LIST" | grep -q "^$SESSION_TITLE$"; then
# # if so, attach to existing session
# zellij attach "$SESSION_TITLE"
# else
# # if not, create a new session
# echo "Creating new session $SESSION_TITLE and CD $ZOXIDE_RESULT"
# cd $ZOXIDE_RESULT
# zellij attach -c "$SESSION_TITLE"
# fi
# '';
in
# in
{
programs.zellij = {
enable = true;