sheldon: add test case

This commit is contained in:
Kyure_A 2024-07-27 00:46:26 +09:00
parent 8e3e635cf1
commit 531f7bae73
3 changed files with 126 additions and 0 deletions

View file

@ -140,6 +140,7 @@ in import nmtSrc {
./modules/programs/scmpuff ./modules/programs/scmpuff
./modules/programs/senpai ./modules/programs/senpai
./modules/programs/sftpman ./modules/programs/sftpman
./modules/programs/sheldon
./modules/programs/sioyek ./modules/programs/sioyek
./modules/programs/sm64ex ./modules/programs/sm64ex
./modules/programs/spotify-player ./modules/programs/spotify-player

View file

@ -0,0 +1,60 @@
shell = "zsh"
[plugins]
[plugins.add-zsh-hook]
inline = "autoload -U add-zsh-hook"
[plugins.anyframe]
github = "mollifier/anyframe"
[plugins.async]
apply = ["defer"]
local = "~/.config/sheldon/async"
use = ["*.zsh"]
[plugins.colors]
inline = "autoload -U colors && zsh-defer colors"
[plugins.compinit]
inline = "autoload -U compinit && zsh-defer compinit -C"
[plugins.fzf]
github = "junegunn/fzf"
[plugins.predict]
inline = "autoload -U predict-on && predict-on"
[plugins.starship]
inline = "eval \"$(starship init zsh)\"\n"
[plugins.sync]
apply = ["source"]
local = "~/.config/sheldon/sync"
use = ["*.zsh"]
[plugins.zcalc]
inline = "autoload -U zcalc"
[plugins.zsh-async]
github = "mafredri/zsh-async"
[plugins.zsh-complations]
apply = ["defer"]
github = "zsh-users/zsh-completions"
[plugins.zsh-defer]
apply = ["source"]
github = "romkatv/zsh-defer"
[plugins.zsh-history-substring-search]
apply = ["defer"]
github = "zsh-users/zsh-history-substring-search"
[plugins.zsh-syntax-highlighting]
apply = ["defer"]
github = "zsh-users/zsh-syntax-highlighting"
[plugins.zsh-terminfo]
inline = "zmodload zsh/terminfo"
[templates]
defer = "{{ hooks | get: \"pre\" | nl }}{% for file in files %}zsh-defer source \"{{ file }}\"\n{% endfor %}{{ hooks | get: \"post\" | nl }}"

View file

@ -0,0 +1,65 @@
{
config = {
programs.sheldon = {
enable = true;
settings = {
shell = "zsh";
plugins = {
async = {
local = "~/.config/sheldon/async";
use = [ "*.zsh" ];
apply = [ "defer" ];
};
sync = {
local = "~/.config/sheldon/sync";
use = [ "*.zsh" ];
apply = [ "source" ];
};
zsh-defer = {
github = "romkatv/zsh-defer";
apply = [ "source" ];
};
add-zsh-hook = { inline = "autoload -U add-zsh-hook"; };
anyframe = { github = "mollifier/anyframe"; };
colors = { inline = "autoload -U colors && zsh-defer colors"; };
compinit = {
inline = "autoload -U compinit && zsh-defer compinit -C";
};
fzf = { github = "junegunn/fzf"; };
predict = { inline = "autoload -U predict-on && predict-on"; };
starship = {
inline = ''
eval "$(starship init zsh)"
'';
};
zcalc = { inline = "autoload -U zcalc"; };
zsh-async = { github = "mafredri/zsh-async"; };
zsh-complations = {
github = "zsh-users/zsh-completions";
apply = [ "defer" ];
};
zsh-history-substring-search = {
github = "zsh-users/zsh-history-substring-search";
apply = [ "defer" ];
};
zsh-syntax-highlighting = {
github = "zsh-users/zsh-syntax-highlighting";
apply = [ "defer" ];
};
zsh-terminfo = { inline = "zmodload zsh/terminfo"; };
};
templates = {
defer = ''
{{ hooks | get: "pre" | nl }}{% for file in files %}zsh-defer source "{{ file }}"
{% endfor %}{{ hooks | get: "post" | nl }}'';
};
};
};
};
test.stubs.sheldon = { };
nmt.script = "assertFileContent home-files/.config/sheldon/plugins.toml ${
./plugins.toml
}";
}