Created
May 5, 2017 07:51
-
-
Save infinisil/e028e66d06cf17e739fe08a628e00ace to your computer and use it in GitHub Desktop.
nixpkgs/nixos/modules/services/network-filesystems/ipfs.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, makeWrapper, ... }: | |
with lib; | |
let | |
inherit (pkgs) ipfs; | |
cfg = config.services.ipfs; | |
wrapped = writeScriptBin "ipfs" '' | |
makeWrapper "${pkgs.ipfs}/bin/ipfs" --set IPFS_PATH ${cfg.dataDir} | |
''; | |
in | |
{ | |
options = { | |
services.ipfs = { | |
dataDir = mkOption { | |
type = types.str; | |
description = "The data dir"; | |
}; | |
}; | |
}; | |
config = { | |
environment.systemPackages = [ wrapped ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment