aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/daemon.hh
blob: 841ace3163009ec862a2b8d8e9fc9e1621fbd650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "serialise.hh"
#include "store-api.hh"

namespace nix::daemon {

enum TrustedFlag : bool { NotTrusted = false, Trusted = true };
enum RecursiveFlag : bool { NotRecursive = false, Recursive = true };

void processConnection(
    ref<Store> store,
    FdSource & from,
    FdSink & to,
    TrustedFlag trusted,
    RecursiveFlag recursive,
    /* Arbitrary hook to check authorization / initialize user data / whatever
       after the protocol has been negotiated. The idea is that this function
       and everything it calls doesn't know about this stuff, and the
       `nix-daemon` handles that instead. */
    std::function<void(Store &)> authHook);

}