Add default-instance check
- validate implicit default instance wires systemd unit name - run new check in garnix Tests: not run (not requested)
This commit is contained in:
parent
90d5c0b2c6
commit
48b5bee635
@ -61,6 +61,7 @@
|
||||
config-options = pkgs.callPackage ./nix/checks/openclaw-config-options.nix {
|
||||
sourceInfo = sourceInfoStable;
|
||||
};
|
||||
default-instance = pkgs.callPackage ./nix/checks/openclaw-default-instance.nix {};
|
||||
hm-activation = import ./nix/checks/openclaw-hm-activation.nix {
|
||||
inherit pkgs home-manager;
|
||||
};
|
||||
|
||||
@ -11,5 +11,6 @@ builds:
|
||||
- "checks.x86_64-linux.gateway"
|
||||
- "checks.x86_64-linux.gateway-tests"
|
||||
- "checks.x86_64-linux.config-options"
|
||||
- "checks.x86_64-linux.default-instance"
|
||||
- "checks.x86_64-linux.config-validity"
|
||||
- "checks.x86_64-linux.package-contents"
|
||||
|
||||
86
nix/checks/openclaw-default-instance.nix
Normal file
86
nix/checks/openclaw-default-instance.nix
Normal file
@ -0,0 +1,86 @@
|
||||
{ lib, pkgs, stdenv }:
|
||||
|
||||
let
|
||||
stubModule = { lib, ... }: {
|
||||
options = {
|
||||
assertions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.attrs;
|
||||
default = [];
|
||||
};
|
||||
|
||||
home.homeDirectory = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/tmp";
|
||||
};
|
||||
|
||||
home.packages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.anything;
|
||||
default = [];
|
||||
};
|
||||
|
||||
home.file = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {};
|
||||
};
|
||||
|
||||
home.activation = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {};
|
||||
};
|
||||
|
||||
launchd.agents = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {};
|
||||
};
|
||||
|
||||
systemd.user.services = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {};
|
||||
};
|
||||
|
||||
programs.git.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
lib = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
eval = lib.evalModules {
|
||||
modules = [
|
||||
stubModule
|
||||
../modules/home-manager/openclaw.nix
|
||||
({ lib, ... }: {
|
||||
config = {
|
||||
home.homeDirectory = "/tmp";
|
||||
programs.git.enable = false;
|
||||
lib.file.mkOutOfStoreSymlink = path: path;
|
||||
programs.openclaw = {
|
||||
enable = true;
|
||||
launchd.enable = false;
|
||||
systemd.enable = true;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
specialArgs = { inherit pkgs; };
|
||||
};
|
||||
|
||||
hasUnit = builtins.hasAttr "openclaw-gateway" eval.config.systemd.user.services;
|
||||
check = if hasUnit then "ok" else throw "Default Openclaw instance missing systemd.unitName.";
|
||||
checkKey = builtins.deepSeq check "ok";
|
||||
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "openclaw-default-instance";
|
||||
version = "1";
|
||||
dontUnpack = true;
|
||||
env = {
|
||||
OPENCLAW_DEFAULT_INSTANCE = checkKey;
|
||||
};
|
||||
installPhase = "${../scripts/empty-install.sh}";
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user