Skip to content

Instantly share code, notes, and snippets.

@infinisil
Created May 5, 2017 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infinisil/e028e66d06cf17e739fe08a628e00ace to your computer and use it in GitHub Desktop.
Save infinisil/e028e66d06cf17e739fe08a628e00ace to your computer and use it in GitHub Desktop.
nixpkgs/nixos/modules/services/network-filesystems/ipfs.nix
{ 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