chore: initial commit

This commit is contained in:
technofab 2025-07-31 12:37:19 +02:00
commit fbacfc149b
No known key found for this signature in database
21 changed files with 748 additions and 0 deletions

53
tests/devshell_test.nix Normal file
View file

@ -0,0 +1,53 @@
{
pkgs,
ntlib,
devshell,
...
}: {
suites."Devshell Tests" = {
pos = __curPos;
tests = [
{
name = "basic";
type = "script";
script = let
shell = devshell.mkShell {};
in
# sh
''
${ntlib.helpers.scriptHelpers}
assert_file_contains ${shell}/env.bash "XDG_DATA_DIRS" "should contain XDG_DATA_DIRS"
'';
}
{
name = "packages";
type = "script";
script = let
shell = devshell.mkShell {
packages = [pkgs.hello];
};
in
# sh
''
${ntlib.helpers.scriptHelpers}
assert "-f ${shell}/bin/hello" "/bin/hello should exist"
'';
}
{
name = "env";
type = "script";
script = let
shell = devshell.mkShell {
env."HELLO".value = "world";
};
in
# sh
''
${ntlib.helpers.scriptHelpers}
assert_file_contains ${shell}/env.bash "HELLO" "should contain HELLO"
assert_file_contains ${shell}/env.bash "world" "should contain world"
'';
}
];
};
}