-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
49 lines (40 loc) · 1.29 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
description = "Flake for development workflows.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/ec750fd01963ab6b20ee1f0cb488754e8036d89d";
gildlab.url = "github:gildlab/gildlab.cli/b45f0e1b2a783f0581c3e8cccd1b1756b49d1376";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, gildlab, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
path = "$HOME/.config/gildlab/ipfs-node";
ensure-home = ''
set -u
export GILDLAB_IPFS_NODE_BASE_PATH=${path}
mkdir -p ${path}
mkdir -p ${path}/volumes/ipfs/data/ipfs
mkdir -p ${path}/volumes/ipfs/export
mkdir -p ${path}/volumes/pin
mkdir -p ${path}/volumes/nginx
touch ${path}/.env
'';
in rec {
packages = rec {
};
devShell = pkgs.mkShell rec {
buildInputs = [
gildlab.defaultPackage.${system}
pkgs.apacheHttpd
];
shellHook = ''
${ensure-home}
source ${path}/.env
export GILDLAB_IPFS_NODE_CHANNEL="''${GILDLAB_IPFS_NODE_CHANNEL:-develop}"
echo "channel is: $GILDLAB_IPFS_NODE_CHANNEL"
'';
};
}
);
}