This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
107 lines (94 loc) · 3.53 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
103
104
105
106
107
{
# nixpkgs collection
inputs = {
nixpkgs.url = "github:flox/nixpkgs/stable";
nixpkgs-stable.url = "github:flox/nixpkgs/stable";
nixpkgs-unstable.url = "github:flox/nixpkgs/unstable";
nixpkgs-staging.url = "github:flox/nixpkgs/staging";
};
# Catalogs
inputs = {
"nixpkgs__flox__aarch64-darwin" = {
url = "github:flox/nixpkgs-flox/aarch64-darwin?host=catalog.floxsdlc.com";
flake = false;
};
"nixpkgs__flox__aarch64-linux" = {
url = "github:flox/nixpkgs-flox/aarch64-linux?host=catalog.floxsdlc.com";
flake = false;
};
"nixpkgs__flox__i686-linux" = {
url = "github:flox/nixpkgs-flox/i686-linux?host=catalog.floxsdlc.com";
flake = false;
};
"nixpkgs__flox__x86_64-linux" = {
url = "github:flox/nixpkgs-flox/x86_64-linux?host=catalog.floxsdlc.com";
flake = false;
};
"nixpkgs__flox__x86_64-darwin" = {
url = "github:flox/nixpkgs-flox/x86_64-darwin?host=catalog.floxsdlc.com";
flake = false;
};
};
# Capacitor inputs
inputs.flox-floxpkgs.url = "github:flox/floxpkgs";
# Clean up of lockfile to re-use entries
inputs.flox.url = "git+ssh://[email protected]/flox/flox?ref=latest";
inputs.flox-floxpkgs.inputs.nixpkgs.follows = "/";
inputs.flox-floxpkgs.inputs.flox.follows = "flox";
inputs.nixpkgs.follows = "nixpkgs-stable";
# bug in Nix cannot support three levels of inputs/inputs/inputs/follows
inputs.flox-floxpkgs.inputs.capacitor.follows = "capacitor";
inputs.capacitor.url = "github:flox/capacitor";
inputs.capacitor.inputs.nixpkgs.follows = "nixpkgs";
outputs = args @ {flox-floxpkgs, ...}:
flox-floxpkgs.project args ({
self,
inputs,
systems,
lib,
...
}: {
config = {
systems = ["aarch64-linux" "aarch64-darwin" "i686-linux" "x86_64-linux" "x86_64-darwin"];
extraPlugins =
[
]
++ (builtins.attrValues (builtins.mapAttrs (
name: catalog:
inputs.flox-floxpkgs.plugins.catalog {
catalogDirectory = catalog;
path = [];
# Baked in assumption that __<system> only contains that system
# TODO: support longer prefixes
includePath = [(lib.strings.removePrefix "nixpkgs__flox__" name)];
}
)
(lib.filterAttrs (name: _: lib.hasPrefix "nixpkgs__flox__" name) inputs)));
};
passthru = {
lib = inputs.nixpkgs-stable.lib;
legacyPackages = lib.genAttrs systems (system: let
stabilities = lib.genAttrs ["stable" "staging" "unstable"] (
stability:
(import inputs."nixpkgs-${stability}" {
config.allowUnfree = true;
inherit system;
})
// {recurseForDerivations = true;}
);
in
# treat nixpkgs input as default nipkgs (following stable, by default)
(import inputs.nixpkgs {
config.allowUnfree = true;
inherit system;
})
// stabilities
// {recurseForDerivations = true;});
stable.legacyPackages = builtins.mapAttrs (_: v: v.stable) self.legacyPackages;
unstable.legacyPackages = builtins.mapAttrs (_: v: v.unstable) self.legacyPackages;
staging.legacyPackages = builtins.mapAttrs (_: v: v.staging) self.legacyPackages;
__functor = _: import inputs.nixpkgs;
# __functionArgs = { config = true; system = true; overlays = true;}; # TODO
};
});
}