1 # Take note the Guix store directory is empty. Also, we're trying to prevent
2 # Guix from trying to downloading substitutes because of the restricted
3 # access (assuming it's in a sandboxed environment).
5 # So this test is what it is: a basic test while trying to use Guix as much as
6 # we possibly can (including the API) without triggering its download alarm.
8 import ../make-test-python.nix ({ lib, pkgs, ... }: {
10 meta.maintainers = with lib.maintainers; [ foo-dogsquared ];
12 nodes.machine = { config, ... }: {
13 environment.etc."guix/scripts".source = ./scripts;
23 machine.wait_for_unit("multi-user.target")
24 machine.wait_for_unit("guix-daemon.service")
25 machine.succeed("systemctl start guix-gc.service")
27 # Can't do much here since the environment has restricted network access.
28 with subtest("Guix basic package management"):
29 machine.succeed("guix build --dry-run --verbosity=0 hello")
30 machine.succeed("guix show hello")
32 # This is to see if the Guix API is usable and mostly working.
33 with subtest("Guix API scripting"):
34 scripts_dir = pathlib.Path("/etc/guix/scripts")
36 text_msg = "Hello there, NixOS!"
37 text_store_file = machine.succeed(f"guix repl -- {scripts_dir}/create-file-to-store.scm '{text_msg}'")
38 assert machine.succeed(f"cat {text_store_file}") == text_msg
40 machine.succeed(f"guix repl -- {scripts_dir}/add-existing-files-to-store.scm {scripts_dir}")