Skip to content

Commit

Permalink
add nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Nov 7, 2023
1 parent 2b7bc3f commit 550d0b9
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 4 deletions.
105 changes: 104 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,43 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/ec750fd01963ab6b20ee1f0cb488754e8036d89d";
gildlab.url = "github:gildlab/gildlab.cli/b45f0e1b2a783f0581c3e8cccd1b1756b49d1376";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, 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}
];

shellHook = ''
${ensure-home}
'';
};
}
);
}
4 changes: 2 additions & 2 deletions pin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM nixos/nix:2.16.1
FROM nixos/nix:2.18.1

# Get latest gildlab cli from main
RUN nix --extra-experimental-features "nix-command flakes" --print-build-logs profile install github:gildlab/gildlab-cli && nix-collect-garbage -d
RUN nix --extra-experimental-features "nix-command flakes" --print-build-logs profile install github:gildlab/gildlab.cli/b45f0e1b2a783f0581c3e8cccd1b1756b49d1376 && nix-collect-garbage -d
RUN gildlab-cli --version

ADD . .
Expand Down

0 comments on commit 550d0b9

Please sign in to comment.