2024-08-31 08:27:10 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2020-05-12 17:20:29 +00:00
|
|
|
|
|
|
|
let
|
2020-08-30 16:06:40 +00:00
|
|
|
plistPath = "${config.out}/user/Library/LaunchAgents/org.nixos.lorri.plist";
|
2024-08-31 08:27:10 +00:00
|
|
|
expectedPath = "${lib.makeBinPath [
|
|
|
|
config.nix.package
|
|
|
|
pkgs.git
|
|
|
|
pkgs.gnutar
|
|
|
|
pkgs.gzip
|
|
|
|
]}";
|
|
|
|
expectedNixPath = "${"nixpkgs=" + toString pkgs.path}";
|
2020-05-12 17:20:29 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
services.lorri.enable = true;
|
|
|
|
test = ''
|
2024-08-31 08:27:10 +00:00
|
|
|
PATH=${
|
|
|
|
lib.makeBinPath [
|
|
|
|
pkgs.xcbuild
|
|
|
|
pkgs.jq
|
|
|
|
]
|
|
|
|
}:$PATH
|
2020-10-31 18:41:41 +00:00
|
|
|
|
|
|
|
plutil -lint ${plistPath}
|
|
|
|
plutil -convert json -o service.json ${plistPath}
|
|
|
|
|
|
|
|
<service.json jq -e ".EnvironmentVariables.PATH == \"${expectedPath}\""
|
|
|
|
<service.json jq -e ".EnvironmentVariables.NIX_PATH == \"${expectedNixPath}\""
|
|
|
|
<service.json jq -e ".KeepAlive == true"
|
|
|
|
<service.json jq -e ".Label == \"org.nixos.lorri\""
|
|
|
|
<service.json jq -e ".ProcessType == \"Background\""
|
|
|
|
<service.json jq -e ".ProgramArguments|length == 3"
|
|
|
|
<service.json jq -e ".ProgramArguments[0] == \"/bin/sh\""
|
|
|
|
<service.json jq -e ".ProgramArguments[1] == \"-c\""
|
2024-08-31 08:27:10 +00:00
|
|
|
<service.json jq -e ".ProgramArguments[2] == \"/bin/wait4path /nix/store && exec ${pkgs.lorri}/bin/lorri daemon\""
|
2020-10-31 18:41:41 +00:00
|
|
|
<service.json jq -e ".RunAtLoad == true"
|
2020-05-12 17:20:29 +00:00
|
|
|
'';
|
|
|
|
}
|