self: { name = "nix-cache-login-nixos-module"; nodes.machine = { ... }: { imports = [ self.nixosModules.default ]; services.nix-cache-login.enable = true; }; testScript = '' machine.wait_for_unit("multi-user.target") # The module should install timer and service unit files for all users machine.succeed("test -f /etc/systemd/user/nix-cache-login.timer") machine.succeed("test -f /etc/systemd/user/nix-cache-login.service") # wantedBy = ["timers.target"] should create this symlink machine.succeed( "test -L /etc/systemd/user/timers.target.wants/nix-cache-login.timer" ) # Service unit should reference the correct subcommand unit = machine.succeed("cat /etc/systemd/user/nix-cache-login.service") assert "nix-cache-login refresh" in unit, ( f"ExecStart not found in service unit:\n{unit}" ) ''; }