🐛 fix up ipfs-darwin service
This commit is contained in:
@ -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; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user