mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
add git, gnutar and gzip to lorri's path
This commit is contained in:
parent
c2124383f4
commit
d037dfaf20
2 changed files with 19 additions and 27 deletions
|
@ -32,7 +32,7 @@ in
|
||||||
environment.systemPackages = [ pkgs.lorri ];
|
environment.systemPackages = [ pkgs.lorri ];
|
||||||
launchd.user.agents.lorri = {
|
launchd.user.agents.lorri = {
|
||||||
command = with pkgs; "${lorri}/bin/lorri daemon";
|
command = with pkgs; "${lorri}/bin/lorri daemon";
|
||||||
path = with pkgs; [ nix ];
|
path = with pkgs; [ config.nix.package git gnutar gzip ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
KeepAlive = true;
|
KeepAlive = true;
|
||||||
RunAtLoad = true;
|
RunAtLoad = true;
|
||||||
|
|
|
@ -1,35 +1,27 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
lorri = pkgs.runCommand "lorri-0.0.0" {} "mkdir $out";
|
|
||||||
plistPath = "${config.out}/user/Library/LaunchAgents/org.nixos.lorri.plist";
|
plistPath = "${config.out}/user/Library/LaunchAgents/org.nixos.lorri.plist";
|
||||||
actual = pkgs.runCommand "convert-plist-to-json" { buildInputs = [ pkgs.xcbuild ]; }
|
expectedPath = "${lib.makeBinPath [config.nix.package pkgs.git pkgs.gnutar pkgs.gzip]}";
|
||||||
"plutil -convert json -o $out ${plistPath}";
|
expectedNixPath = "${"nixpkgs="+ toString pkgs.path}";
|
||||||
actualJson = builtins.fromJSON (builtins.readFile "${actual.out}");
|
|
||||||
expectedJson = builtins.fromJSON ''
|
|
||||||
{
|
|
||||||
"EnvironmentVariables": {
|
|
||||||
"NIX_PATH": "${"nixpkgs="+ toString pkgs.path}",
|
|
||||||
"PATH": "${builtins.unsafeDiscardStringContext pkgs.nix}/bin"
|
|
||||||
},
|
|
||||||
"KeepAlive": true,
|
|
||||||
"Label": "org.nixos.lorri",
|
|
||||||
"ProcessType": "Background",
|
|
||||||
"ProgramArguments": [
|
|
||||||
"/bin/sh",
|
|
||||||
"-c",
|
|
||||||
"exec ${builtins.unsafeDiscardStringContext pkgs.lorri}/bin/lorri daemon"
|
|
||||||
],
|
|
||||||
"RunAtLoad": true
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
testResult = toString (actualJson == expectedJson);
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.lorri.enable = true;
|
services.lorri.enable = true;
|
||||||
test = ''
|
test = ''
|
||||||
${pkgs.xcbuild}/bin/plutil -lint ${plistPath}
|
PATH=${lib.makeBinPath [ pkgs.xcbuild pkgs.jq ]}:$PATH
|
||||||
[ ${testResult} ];
|
|
||||||
|
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\""
|
||||||
|
<service.json jq -e ".ProgramArguments[2] == \"exec ${pkgs.lorri}/bin/lorri daemon\""
|
||||||
|
<service.json jq -e ".RunAtLoad == true"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue