📦 add fission overlay
This commit is contained in:
@ -9,23 +9,39 @@ in
|
||||
options = {
|
||||
services.ipfs = {
|
||||
enable = mkEnableOption "Enable kubo on darwin";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.kubo_carmirror;
|
||||
defaultText = literalExpression "pkgs.kubo";
|
||||
description = "The package to use for kubo";
|
||||
};
|
||||
|
||||
logFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = "/var/tmp/ipfs.log";
|
||||
description = "Absolute path to log stderr / stdout";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.ipfs ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
launchd.user.agents.ipfs = {
|
||||
path = [ pkgs.ipfs ];
|
||||
path = [ cfg.package ];
|
||||
script = ''
|
||||
if ! test -e $HOME/.ipfs/version; then
|
||||
ipfs init
|
||||
${cfg.package}/bin/ipfs init
|
||||
fi
|
||||
ipfs daemon --migrate
|
||||
${cfg.package}/bin/ipfs daemon --migrate
|
||||
'';
|
||||
serviceConfig = {
|
||||
KeepAlive = true;
|
||||
RunAtLoad = true;
|
||||
ProcessType = "Background";
|
||||
StandardErrorPath = cfg.logFile;
|
||||
StandardOutPath = cfg.logFile;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user