Darkfi - Nixos impure flake

Installation (impure)

This flake sticks to the initial design and uses Makefiles maintainedby the DarkFi core team.

Using nix builders would make the package evaluation pure, but would although lead to duplicate and unevitably to an out of date flake.

Make this flake pure

Prerequisites

The flake buildPhases need network access that are by default disabled by nix.

You need to first *relax nix build sandbox parameter to allow impure builds.

Either in your nixos configuration:

# configuration.nix
nix.settings.sandbox = "relaxed"

or exceptionnaly via command-line as an argument of an installation command.

nix-env -i github:darkrenaissance/darki?dir=contrib/nix --no-sandbox

Declaration

Import it in your flake inputs.

inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    darkfi.url = "github:pipelight/darkfi.nix";
};

Add the packages to your environment or to a specific users.

environment.systemPackages = with pkgs; [
    inputs.darkfi.packages.${system}.default
];

Enable background services

Add a user systemd unit with home-manager.

# home.nix
## Darkirc messaging background service
systemd.user.services."darkirc" = {
  enable = true;
  after = ["network.target"];
  serviceConfig = {
    ExecStart = "${darkfi}/bin/darkirc";
  };
  wantedBy = ["multi-user.target"];
};