# `checks.script-test-agent-hive-facts` — runs the two readers of # `/etc/hyperhive-hive-facts` in ../agent-modules/hive-facts.nix: the systemd # environment generator and the login-shell snippet `/etc/set-environment` # sources. The cases are in ./agent-hive-facts.sh. # # What runs is the rendered generator and snippet. The one edit is the facts # file's path, moved under the build directory, and the snippet's reference to # the generator, pointed at that edited copy. { pkgs, lib, self, nixosSystem, }: let inherit (import ../module-eval/lib.nix { inherit pkgs lib self nixosSystem ; }) agentWith ; machine = agentWith { services.hyperhive.agent.user.name = "a1"; }; in pkgs.runCommand "hyperhive-script-test-agent-hive-facts" { GENERATOR = machine.environment.etc."systemd/system-environment-generators/50-hyperhive-hive-facts".source; PROFILE = machine.environment.etc."hyperhive/hive-facts.sh".source; EXTRA_INIT = machine.environment.extraInit; SHELLS = "${pkgs.dash}/bin/dash ${pkgs.bash}/bin/sh"; } '' ${pkgs.bash}/bin/bash ${./agent-hive-facts.sh} touch "$out" ''