Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
buildenv.hh
Go to the documentation of this file.
1#pragma once
3
5#include "nix/util/fmt.hh"
6
7namespace nix {
8
12struct Package
13{
14 std::filesystem::path path;
15 bool active;
16 int priority;
17
18 Package(const std::filesystem::path & path, bool active, int priority)
19 : path{path}
20 , active{active}
21 , priority{priority}
22 {
23 }
24};
25
26class BuildEnvFileConflictError final : public CloneableError<BuildEnvFileConflictError, Error>
27{
28private:
29 void anchor() override;
30
31public:
32 const std::filesystem::path fileA;
33 const std::filesystem::path fileB;
34 int priority;
35
36 BuildEnvFileConflictError(const std::filesystem::path fileA, const std::filesystem::path fileB, int priority)
37 : CloneableError(
38 "Unable to build profile. There is a conflict for the following files:\n"
39 "\n"
40 " %1%\n"
41 " %2%",
42 PathFmt(fileA),
43 PathFmt(fileB))
44 , fileA(fileA)
45 , fileB(fileB)
46 , priority(priority)
47 {
48 }
49};
50
51typedef std::vector<Package> Packages;
52
53void buildProfile(const std::filesystem::path & out, Packages && pkgs);
54
55} // namespace nix
Definition fmt.hh:115