🐛 fix up ipfs-darwin service

This commit is contained in:
James Walker 2022-11-17 22:39:47 -05:00
parent d845616f35
commit fe5e3da48d
Signed by: walkah
GPG Key ID: 3C127179D6086E93
3 changed files with 23 additions and 27 deletions

30
flake.lock generated
View File

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1667419884,
"narHash": "sha256-oLNw87ZI5NxTMlNQBv1wG2N27CUzo9admaFlnmavpiY=",
"lastModified": 1668534244,
"narHash": "sha256-8sgzegrEVUZMJUg4jEiC6pokeMPY02BFe49iXnVrXkk=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "cfc0125eafadc9569d3d6a16ee928375b77e3100",
"rev": "4182ad42d5fb5001adb1f61bec3a04fae0eecb95",
"type": "github"
},
"original": {
@ -28,11 +28,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1668166163,
"narHash": "sha256-XCuM+n98KcG0v+DT1HolGCO3j5FOBUjV4K8YcZsVeQw=",
"lastModified": 1668453806,
"narHash": "sha256-rDyF0essyFdCIo336gI6nPjWhjoczGn701D1JID5wl8=",
"owner": "serokell",
"repo": "deploy-rs",
"rev": "b011f13bc577b978f52aaefde5605332f7bca7e9",
"rev": "be40823735bbdc40c1f6b7725c8b74d5a85d8023",
"type": "github"
},
"original": {
@ -76,11 +76,11 @@
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
@ -141,11 +141,11 @@
"utils": "utils_2"
},
"locked": {
"lastModified": 1668332334,
"narHash": "sha256-YT1qcE/MCqBO1Bi/Yr6GcFpNKsvmzrBKh8juyXDbxQc=",
"lastModified": 1668716823,
"narHash": "sha256-e6d2SIIiJOvTzItUbp+GJVhPD6AzSm823XAyPvPlpvo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "bc90de24d898655542589237cc0a6ada7564cb6c",
"rev": "fe85cc4c37d5f37104e349c5553029417e3833d1",
"type": "github"
},
"original": {
@ -220,11 +220,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1668266328,
"narHash": "sha256-+nAW+XR8nswyEnt5IkQlkrz9erTcQWBVLkhtNHxckFw=",
"lastModified": 1668650906,
"narHash": "sha256-JuiYfDO23O8oxUUOmhQflmOoJovyC5G4RjcYQMQjrRE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5ca8e2e9e1fa5e66a749b39261ad6bd0e07bc87f",
"rev": "3a86856a13c88c8c64ea32082a851fefc79aa700",
"type": "github"
},
"original": {

View File

@ -32,11 +32,11 @@
"google-chrome"
"gpg-suite"
"hazel"
"ipfs"
"iterm2"
"keybase"
"logi-options-plus"
"logseq"
"loom"
"minecraft"
"obsidian"
"plexamp"

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