🐛 fix up ipfs-darwin service

This commit is contained in:
2022-11-17 22:39:47 -05:00
parent d845616f35
commit fe5e3da48d
3 changed files with 23 additions and 27 deletions

View File

@ -9,12 +9,6 @@ in
options = {
services.ipfs = {
enable = mkEnableOption "Enable kubo on darwin";
logFile = mkOption {
type = types.nullOr types.path;
default = "/var/tmp/ipfs.log";
description = "Absolute path to log all stderr and stdout";
};
};
};
@ -22,14 +16,16 @@ in
environment.systemPackages = [ pkgs.ipfs ];
launchd.user.agents.ipfs = {
command = with pkgs; "${ipfs}/bin/ipfs daemon --migrate";
path = [ pkgs.ipfs ];
script = ''
if ! test -e $HOME/.ipfs/version; then
ipfs init
fi
ipfs daemon --migrate
'';
serviceConfig = {
KeepAlive = true;
RunAtLoad = true;
ProcessType = "Background";
StandardOutPath = cfg.logFile;
StandardErrorPath = cfg.logFile;
EnvironmentVariables = { NIX_PATH = "nixpkgs=" + toString pkgs.path; };
};
};
};