mirror of
https://gitlab.com/TECHNOFAB/nixible.git
synced 2026-02-02 11:25:08 +01:00
feat: switch from flake-parts and devenv to rensa ecosystem
This commit is contained in:
parent
0a0d354962
commit
dcb87e8c3e
21 changed files with 649 additions and 652 deletions
39
tests/flake_parts_test.nix
Normal file
39
tests/flake_parts_test.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
pkgs,
|
||||
ntlib,
|
||||
...
|
||||
}: {
|
||||
suites."flake-parts" = {
|
||||
pos = __curPos;
|
||||
tests = [
|
||||
{
|
||||
name = "flakeModule";
|
||||
type = "script";
|
||||
script =
|
||||
# sh
|
||||
''
|
||||
${ntlib.helpers.path (with pkgs; [coreutils nix gnused gnugrep jq])}
|
||||
${ntlib.helpers.scriptHelpers}
|
||||
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
export NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
repo_path=${../.}
|
||||
|
||||
cp ${./fixtures/flake_parts}/* .
|
||||
# import from the absolute path above, is easier than trying to figure out the repo path etc.
|
||||
sed -i -e "s|@repo_path@|$repo_path|" flake.nix
|
||||
|
||||
# NOTE: --impure is required since importing modules from absolute paths is not allowed in pure mode
|
||||
nix build --impure .#nixible:test
|
||||
assert "-f result/bin/nixible" "should exist"
|
||||
assert_file_contains "result/bin/nixible" "ANSIBLE_COLLECTIONS_PATH"
|
||||
assert_file_contains "result/bin/nixible" "ansible-playbook"
|
||||
|
||||
nix build --impure .#nixible:hello
|
||||
assert "-f result/bin/nixible" "should exist"
|
||||
assert_file_contains "result/bin/nixible" "ANSIBLE_COLLECTIONS_PATH"
|
||||
assert_file_contains "result/bin/nixible" "ansible-playbook"
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue