-
Notifications
You must be signed in to change notification settings - Fork 47
/
default.nix
56 lines (52 loc) · 1.63 KB
/
default.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
{inputs, ...}: let
inherit (builtins) throw;
inherit (inputs.nixpkgs.lib) warn hasSuffix filesystem optionalString assertOneOf;
in {
flake.lib = {
mkPatches = dir:
map (e: /. + e)
(builtins.filter
(hasSuffix ".patch")
(filesystem.listFilesRecursive dir));
legendaryBuilder = pkgs: {
games ? {},
opts ? {},
}:
builtins.attrValues (builtins.mapAttrs (
name: value:
pkgs.callPackage ../pkgs/legendary
({
inherit (inputs.self.packages.${pkgs.hostPlatform.system}) wine-discord-ipc-bridge;
pname = name;
}
// opts
// value)
)
games);
mkDeprecated = variant: return: {
target, # what to deprecate: "package" or "module"
name, # name of the deprecated component
instructions, # instructions to migrate away from the deprecated component
repo ? "nix-gaming", # not likely to change, but just in case
date ? "", # optionally allow supplying a date
}: let
optionalDate = optionalString (date != "") " as of ${date}";
# constructed warning message
message = assert assertOneOf "target" target ["package" "module"]; ''
The ${target} ${name} in ${repo} has been deprecated${optionalDate}.
${instructions}
'';
in
if variant == "warn"
then warn message return
else if variant == "throw"
then throw message
else
# could this be asserted earlier?
throw ''
Unknown variant: ${variant}. Must be one of:
- warn
- throw
'';
};
}