Merge branch 'def/nix-collect-garbage-endpoint' of git.selfprivacy.org:SelfPrivacy/selfprivacy-rest-api into def/nix-collect-garbage-endpoint

pull/21/head
dettlaff 2023-06-18 08:44:53 +04:00
commit aa85b6963b
3 changed files with 41 additions and 9 deletions

BIN
dump.rdb

Binary file not shown.

View File

@ -10,15 +10,15 @@ from selfprivacy_api.graphql import schema
# from selfprivacy_api.graphql.schema import Subscription
from selfprivacy_api.jobs.nix_collect_garbage import (
get_dead_packages,
nix_collect_garbage,
parse_line,
CLEAR_COMPLETED,
COMPLETED_WITH_ERROR,
stream_process,
RESULT_WAS_NOT_FOUND_ERROR,
)
# from selfprivacy_api.jobs.nix_collect_garbage import (
# get_dead_packages,
# nix_collect_garbage,
# parse_line,
# CLEAR_COMPLETED,
# COMPLETED_WITH_ERROR,
# stream_process,
# RESULT_WAS_NOT_FOUND_ERROR,
# )
pytest_plugins = ("pytest_asyncio",)

32
zsh-config.nix Normal file
View File

@ -0,0 +1,32 @@
{ pkgs }:
let
zshWithPlugins = pkgs.zsh.overrideAttrs (oldAttrs: {
postInstall = oldAttrs.postInstall + ''
# Create symlinks for plugins in $out/share
mkdir -p $out/share/zsh/plugins
ln -s ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions $out/share/zsh/plugins/autosuggestions
ln -s ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting $out/share/zsh/plugins/syntax-highlighting
'';
});
in
{
shell = zshWithPlugins;
shellSetup = ''
# create .zshrc file if it doesnt exist
if [ ! -f ~/.zshrc ]; then
echo "Creating a default .zshrc file..."
touch ~/.zshrc
fi
# add zsh-autosuggestions and zsh-syntax-highlighting in zshrc
if ! grep -q "source .*zsh-autosuggestions.zsh" ~/.zshrc; then
echo "Adding zsh-autosuggestions plugin to .zshrc..."
echo "source ${zshWithPlugins}/share/zsh/plugins/autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc
fi
if ! grep -q "source .*zsh-syntax-highlighting.zsh" ~/.zshrc; then
echo "Adding zsh-syntax-highlighting plugin to .zshrc..."
echo "source ${zshWithPlugins}/share/zsh/plugins/syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc
fi
'';
}