This repository has been archived by the owner on Jan 31, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
102 lines (94 loc) · 3.63 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
description = "Floxpkgs/Project Template";
inputs.flox-floxpkgs.url = "github:flox/floxpkgs";
# Declaration of external resources
# =================================
# An example import of a "capacitated" project
/*
inputs.my-project.url = "github:me/myproject";
*/
# =================================
outputs = args @ {flox-floxpkgs, ...}:
flox-floxpkgs.project args (context: {
# explicit package definitions
# the format is equivalent to package definitions in
# `./pkgs/my-pkg/default.nix`
packages = {
# explicit packages allow re-exports of single packages
# from package sets that can't be accessed by all users of this project
#
# Note: re-exporting generally provides less guarantees
# than importing a package set in terms of composability.
# `config.projects` should be used preferably, if possible.
#
# Note: if re-export comes from a capacitated flake,
# use `context.capacitated` over `context.inputs`
# to ensure coherent dependencies.
/*
ext-pkg = context: context.capacitated.my-project.packages.ext-pkg;
*/
};
config = {
# by default all packages defined in this flake will be buildable on
# the four most common platforms.
# `config.settings` allows additional systems to be configured
# by overriding the default set
/*
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
*/
nixpkgs-config = {
# Unfree licenses are disallowed by default
# but can be enabled on a per-project basis.
#
# If an unfree package is imported by one of your packages,
# trying to build the package will raise an error like:
#
# Package 'slack-4.29.149' in /nix/store/... has an unfree license
# ('unfree'), refusing to evaluate.
#
# The configuration below shows how to permit the usage of "slack"
# or other tools that run into this problem.
#
# Note: the configuration only applies to the current project
# and overrides the config in projects.
# It also affects only packages when accessed through the
# `context` - either in a package definition
# or `context.nixpkgs.slack`.
/*
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"slack"
];
*/
};
# `config.projects` can be used to compose capacitated package sets.
# All packages defined in the imported projects will be merged
# and become available in the `context` of this flake.
#
# Note: composing package sets may require rebuilding some packages
# as some dependency versions may differ
# from one package set to another.
# composing such package sets ensures a single coherent set.
projects = {
/*
inherit (context.capacitated) my-project;
*/
};
# If a package is already defined by an imported project
# (see `config.projects`) an error will be thrown asking to rename
# the local package or ensure that it is compatible
# with the existing package.
# If you choose to attest its compatibility,
# add the name of the package here, as instructed at build time.
checkedExtensions = [
/*
"some-package"
*/
];
};
});
}