Skip to content

DavidRConnell/neo4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neo4j flake

Provides neo4j. To use you need to use the provided wrapper and supply a path for the db via overriding db-home (most have write access), the default path is /homeless-shelter which will error because it doesn’t exist. Additionally, auth-enabled is a boolean that can be overridden to enable or disable authentication (defaults to false).

Plugins will be added to the plugins directory as they are needed. A list of plugins can also be supplied to the wrapper. Plugins are exposed in the flake so any flake depending on this flake can get them. External plugins can also be used.

Example of using in another flake:

{
  description = "Example of using neo4j";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs";
    flake-utils = {
      url = "github:numtide/flake-utils";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    neo4j = {
      url = "github:DavidRConnell/neo4j";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.flake-utils.follows = "flake-utils";
    };
  };

  outputs = { self, nixpkgs, flake-utils, neo4j }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
        # Need a way to avoid hardcoding user's home directory.
        db-home = "/home/user/.local/share/neo4j/example";
        auth-enabled = false; # The default so could be omitted.
        plugins = (with neo4j.plugins.${system}; [ gds ]);
        neo4jEnv = neo4j.packages.${system}.neo4jWrapper.override {
          inherit db-home auth-enabled plugins;
        };
      in { devShell = pkgs.mkShell { buildInputs = [ neo4jEnv ]; }; });
}

Creating plugins

New plugins should be a derivative with their jar files in "$out/share/neo4j/plugins". If you have a prebuilt copy of the plugin (like for ./plugins/graph-data-science.nix) you can use the packager neo4j.mkPlugin.${system}.prebuilt (where neo4j is the name of this flake as in the example above). In the future, I will likely add other packager/builders to build packages from source.

If a plugin needs unrestricted access, set it’s unrestricted attribute to true (see ./plugins/graph-data-science.nix).

About

Nix flake for neo4j

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages