Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ff16a8b8e9ff
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d278891db559
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 3, 2020

  1. nixos/modules/services/network-filesystems/ipfs: refactor

    Add `package` option to change the package used for the service.
    fabianhjr committed Nov 3, 2020
    Copy the full SHA
    acd3d3d View commit details

Commits on Nov 4, 2020

  1. Merge pull request #102676 from LibreCybernetics/add-pkg-option-to-ip…

    …fs-service
    
    nixos/modules/services/network-filesystems/ipfs: refactor
    Ericson2314 authored Nov 4, 2020
    Copy the full SHA
    d278891 View commit details
Showing with 12 additions and 5 deletions.
  1. +12 −5 nixos/modules/services/network-filesystems/ipfs.nix
17 changes: 12 additions & 5 deletions nixos/modules/services/network-filesystems/ipfs.nix
Original file line number Diff line number Diff line change
@@ -44,6 +44,13 @@ in {

enable = mkEnableOption "Interplanetary File System (WARNING: may cause severe network degredation)";

package = mkOption {
type = types.package;
default = pkgs.ipfs;
defaultText = "pkgs.ipfs";
description = "Which IPFS package to use.";
};

user = mkOption {
type = types.str;
default = "ipfs";
@@ -176,7 +183,7 @@ in {
###### implementation

config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.ipfs ];
environment.systemPackages = [ cfg.package ];
environment.variables.IPFS_PATH = cfg.dataDir;

programs.fuse = mkIf cfg.autoMount {
@@ -207,14 +214,14 @@ in {
"d '${cfg.ipnsMountDir}' - ${cfg.user} ${cfg.group} - -"
];

systemd.packages = [ pkgs.ipfs ];
systemd.packages = [ cfg.package ];

systemd.services.ipfs-init = {
description = "IPFS Initializer";

environment.IPFS_PATH = cfg.dataDir;

path = [ pkgs.ipfs ];
path = [ cfg.package ];

script = ''
if [[ ! -f ${cfg.dataDir}/config ]]; then
@@ -239,7 +246,7 @@ in {
};

systemd.services.ipfs = {
path = [ "/run/wrappers" pkgs.ipfs ];
path = [ "/run/wrappers" cfg.package ];
environment.IPFS_PATH = cfg.dataDir;

wants = [ "ipfs-init.service" ];
@@ -267,7 +274,7 @@ in {
cfg.extraConfig))
);
serviceConfig = {
ExecStart = ["" "${pkgs.ipfs}/bin/ipfs daemon ${ipfsFlags}"];
ExecStart = ["" "${cfg.package}/bin/ipfs daemon ${ipfsFlags}"];
User = cfg.user;
Group = cfg.group;
} // optionalAttrs (cfg.serviceFdlimit != null) { LimitNOFILE = cfg.serviceFdlimit; };