mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
add IFPS module
This commit is contained in:
parent
79f1b28158
commit
263ca88d61
2 changed files with 48 additions and 1 deletions
38
modules/ipfs.nix
Normal file
38
modules/ipfs.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.sconfig.ipfs;
|
||||
in
|
||||
{
|
||||
options.sconfig.ipfs = {
|
||||
|
||||
enable = lib.mkEnableOption "Turn on IPFS";
|
||||
|
||||
lowpower = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "enable the 'lowpower' profile in IPFS.";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
services.ipfs = {
|
||||
enable = true;
|
||||
emptyRepo = true;
|
||||
gatewayAddress = "/ip4/127.0.0.1/tcp/8001";
|
||||
# Had issues without fdlimit. 65536 value taken from nixpkgs example
|
||||
serviceFdlimit = 65536;
|
||||
};
|
||||
|
||||
systemd.services.ipfs = {
|
||||
preStart = lib.mkAfter (lib.optionalString cfg.lowpower ''
|
||||
ipfs --offline config profile apply lowpower
|
||||
'');
|
||||
postStart = ''
|
||||
chmod g+r /var/lib/ipfs/config
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
}
|
|
@ -12,7 +12,16 @@ in
|
|||
|
||||
users.users.sean = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "audio" "video" "networkmanager" "dialout" "input" "wireshark" ];
|
||||
extraGroups = [
|
||||
"audio"
|
||||
"dialout"
|
||||
"input"
|
||||
"networkmanager"
|
||||
"video"
|
||||
"wheel"
|
||||
"wireshark"
|
||||
config.services.ipfs.group
|
||||
];
|
||||
openssh.authorizedKeys = { inherit keys; };
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue