🐛 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

View File

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

View File

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

View File

@ -9,12 +9,6 @@ in
options = { options = {
services.ipfs = { services.ipfs = {
enable = mkEnableOption "Enable kubo on darwin"; 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 ]; environment.systemPackages = [ pkgs.ipfs ];
launchd.user.agents.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 = { serviceConfig = {
KeepAlive = true; KeepAlive = true;
RunAtLoad = true; RunAtLoad = true;
ProcessType = "Background";
StandardOutPath = cfg.logFile;
StandardErrorPath = cfg.logFile;
EnvironmentVariables = { NIX_PATH = "nixpkgs=" + toString pkgs.path; };
}; };
}; };
}; };