📦 add fission overlay

This commit is contained in:
James Walker 2023-03-15 15:56:51 -04:00
parent 7bb0ca2d52
commit 07130a5a41
Signed by: walkah
GPG Key ID: 3C127179D6086E93
5 changed files with 1121 additions and 37 deletions

1123
flake.lock

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,8 @@
url = "github:walkah/workon";
inputs.nixpkgs.follows = "nixpkgs";
};
fission.url = "github:fission-codes/nix-overlay";
};
outputs =
@ -59,6 +61,7 @@
, devenv
, dotfiles
, workon
, fission
, ...
}@inputs:
let
@ -67,6 +70,7 @@
workon = workon.packages.${self.system}.default;
inherit (devenv.packages.${self.system}) devenv;
})
fission.overlay
];
mkSystem = hostName: system: modules:

View File

@ -25,7 +25,10 @@
};
services.lorri.enable = true;
services.ipfs.enable = true;
services.ipfs = {
enable = true;
package = pkgs.kubo_carmirror;
};
programs = {
zsh = {

View File

@ -40,5 +40,7 @@
# My stuff
workon
fission-cli
carmirror
];
}

View File

@ -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;
};
};
};