kiro-cli: add module

This commit is contained in:
superflash41
2026-06-10 09:48:41 -05:00
committed by Austin Horstman
parent 6cf5b64c12
commit 74887eaee2
5 changed files with 113 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
{
programs = {
kiro-cli.enable = true;
bash.enable = true;
};
test.stubs.kiro-cli = {
name = "kiro-cli";
};
nmt.script = ''
assertFileExists home-files/.bashrc
assertFileContains home-files/.bashrc \
'eval "$(@kiro-cli@/bin/kiro-cli init bash pre)"'
assertFileContains home-files/.bashrc \
'eval "$(@kiro-cli@/bin/kiro-cli init bash post)"'
preLine=$(grep -n 'init bash pre' $TESTED/home-files/.bashrc | head -n1 | cut -d: -f1)
postLine=$(grep -n 'init bash post' $TESTED/home-files/.bashrc | head -n1 | cut -d: -f1)
if [[ "$preLine" -ge "$postLine" ]]; then
fail "kiro-cli 'pre' snippet (line $preLine) must appear before 'post' snippet (line $postLine) in .bashrc"
fi
'';
}
@@ -0,0 +1,4 @@
{
kiro-cli-bash = ./bash.nix;
kiro-cli-zsh = ./zsh.nix;
}
+24
View File
@@ -0,0 +1,24 @@
{
programs = {
kiro-cli.enable = true;
zsh.enable = true;
};
test.stubs.kiro-cli = {
name = "kiro-cli";
};
nmt.script = ''
assertFileExists home-files/.zshrc
assertFileContains home-files/.zshrc \
'eval "$(@kiro-cli@/bin/kiro-cli init zsh pre)"'
assertFileContains home-files/.zshrc \
'eval "$(@kiro-cli@/bin/kiro-cli init zsh post)"'
preLine=$(grep -n 'init zsh pre' $TESTED/home-files/.zshrc | head -n1 | cut -d: -f1)
postLine=$(grep -n 'init zsh post' $TESTED/home-files/.zshrc | head -n1 | cut -d: -f1)
if [[ "$preLine" -ge "$postLine" ]]; then
fail "kiro-cli 'pre' snippet (line $preLine) must appear before 'post' snippet (line $postLine) in .zshrc"
fi
'';
}