✨ add ipfs service for darwin machines
This commit is contained in:
parent
da846292a6
commit
d845616f35
36
flake.lock
generated
36
flake.lock
generated
@ -28,11 +28,11 @@
|
|||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659725433,
|
"lastModified": 1668166163,
|
||||||
"narHash": "sha256-1ZxuK67TL29YLw88vQ18Y2Y6iYg8Jb7I6/HVzmNB6nM=",
|
"narHash": "sha256-XCuM+n98KcG0v+DT1HolGCO3j5FOBUjV4K8YcZsVeQw=",
|
||||||
"owner": "serokell",
|
"owner": "serokell",
|
||||||
"repo": "deploy-rs",
|
"repo": "deploy-rs",
|
||||||
"rev": "41f15759dd8b638e7b4f299730d94d5aa46ab7eb",
|
"rev": "b011f13bc577b978f52aaefde5605332f7bca7e9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -141,11 +141,11 @@
|
|||||||
"utils": "utils_2"
|
"utils": "utils_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667981810,
|
"lastModified": 1668332334,
|
||||||
"narHash": "sha256-p27zd5M+OkfND46gzbGkaHlNBZsYe95M48OJuFeuuSY=",
|
"narHash": "sha256-YT1qcE/MCqBO1Bi/Yr6GcFpNKsvmzrBKh8juyXDbxQc=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "6ce3493a3c5c6a8f4cfa6f5f88723272e0cfd335",
|
"rev": "bc90de24d898655542589237cc0a6ada7564cb6c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -156,11 +156,11 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668005176,
|
"lastModified": 1668334946,
|
||||||
"narHash": "sha256-1Z6ysp8I7NvK8ccL0+r8GI5mxzVqhPLVCI01uPg1ul4=",
|
"narHash": "sha256-omMbUj4r5DVBWh7KxkoO/Z/1V1shVR6Ls4jXNB4mr3U=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "909f0259470f6e9edea71f281410ef25bfa274ee",
|
"rev": "e0452b33ab0ef16ffe075e980644ed92a6a200bb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -188,11 +188,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-22_05": {
|
"nixpkgs-22_05": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667091951,
|
"lastModified": 1668307144,
|
||||||
"narHash": "sha256-62sz0fn06Nq8OaeBYrYSR3Y6hUcp8/PC4dJ7HeGaOhU=",
|
"narHash": "sha256-uY2StvGJvTfgtLaiz3uvX+EQeWZDkiLFiz2vekgJ9ZE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6440d13df2327d2db13d3b17e419784020b71d22",
|
"rev": "eac99848dfd869e486573d8272b0c10729675ca2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -220,11 +220,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667969101,
|
"lastModified": 1668266328,
|
||||||
"narHash": "sha256-GL53T705HO7Q/KVfbb5STx8AxFs8YgaGY8pvAZC+O7U=",
|
"narHash": "sha256-+nAW+XR8nswyEnt5IkQlkrz9erTcQWBVLkhtNHxckFw=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bbf77421ac51a7c93f5f0f760da99e4dbce614fa",
|
"rev": "5ca8e2e9e1fa5e66a749b39261ad6bd0e07bc87f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -256,11 +256,11 @@
|
|||||||
"nixpkgs-22_05": "nixpkgs-22_05"
|
"nixpkgs-22_05": "nixpkgs-22_05"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667767301,
|
"lastModified": 1668311578,
|
||||||
"narHash": "sha256-+UDtEkw6pZ+sqkC0Um5ocJ9kjvuu0qffSCbl+jAA8K8=",
|
"narHash": "sha256-nF6mwSbVyvnlIICWFZlADegWdTsgrk1pZnA/0VqByNw=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "4407353739ad74a3d9744cf2988ab10f3b83e288",
|
"rev": "39f0fe57f1ef78764c1abc1de145f091fee1bbbb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
../../modules/base/darwin.nix
|
../../modules/base/darwin.nix
|
||||||
../../modules/dev
|
../../modules/dev
|
||||||
../../modules/builder
|
../../modules/builder
|
||||||
|
|
||||||
|
../../services/ipfs-darwin.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowBroken = true;
|
nixpkgs.config.allowBroken = true;
|
||||||
@ -27,6 +29,7 @@
|
|||||||
home-manager.users.walkah = import "${dotfiles}/home.nix";
|
home-manager.users.walkah = import "${dotfiles}/home.nix";
|
||||||
|
|
||||||
services.lorri.enable = true;
|
services.lorri.enable = true;
|
||||||
|
services.ipfs.enable = true;
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
zsh = {
|
zsh = {
|
||||||
|
36
services/ipfs-darwin.nix
Normal file
36
services/ipfs-darwin.nix
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.ipfs;
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ pkgs.ipfs ];
|
||||||
|
|
||||||
|
launchd.user.agents.ipfs = {
|
||||||
|
command = with pkgs; "${ipfs}/bin/ipfs daemon --migrate";
|
||||||
|
serviceConfig = {
|
||||||
|
KeepAlive = true;
|
||||||
|
RunAtLoad = true;
|
||||||
|
ProcessType = "Background";
|
||||||
|
StandardOutPath = cfg.logFile;
|
||||||
|
StandardErrorPath = cfg.logFile;
|
||||||
|
EnvironmentVariables = { NIX_PATH = "nixpkgs=" + toString pkgs.path; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user