home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

ipfs.nix (917B)


      1 { config, lib, pkgs, ... }:
      2 
      3 with lib;
      4 let
      5   cfg = config.profiles.ipfs;
      6 in
      7 {
      8   options = {
      9     profiles.ipfs = {
     10       enable = mkEnableOption "Enable ipfs profile";
     11       autoMount = mkOption {
     12         default = true;
     13         description = "Automount /ipfs and /ipns";
     14         type = types.bool;
     15       };
     16       localDiscovery = mkOption {
     17         default = true;
     18         description = "Enable local discovery, switch profile to server if disable";
     19         type = types.bool;
     20       };
     21       extraConfig = mkOption {
     22         default = {
     23           Datastore.StorageMax = "40GB";
     24         };
     25         description = "Extra ipfs daemon configuration";
     26         type = types.attrs;
     27       };
     28     };
     29   };
     30   config = mkIf cfg.enable {
     31     services.ipfs = {
     32       enable = true;
     33       enableGC = true;
     34       localDiscovery = cfg.localDiscovery;
     35       autoMount = cfg.autoMount;
     36       extraConfig = cfg.extraConfig;
     37     };
     38   };
     39 }