generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
190 lines (182 loc) · 6.46 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
{
description = "My personal NUR repository";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
nixpkgs-24_05.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-parts.url = "github:hercules-ci/flake-parts";
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nvfetcher = {
url = "github:berberman/nvfetcher";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks-nix = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self, flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } (
{
flake-parts-lib,
lib,
config,
...
}:
let
inherit (flake-parts-lib) importApply;
flakeModules = {
auto-apps-shell = ./flake-modules/auto-apps-shell.nix;
auto-colmena-hive = ./flake-modules/auto-colmena-hive-v0.nix;
auto-colmena-hive-v0 = ./flake-modules/auto-colmena-hive-v0.nix;
auto-colmena-hive-v0_20241006 = ./flake-modules/auto-colmena-hive-v0_20241006.nix;
commands = ./flake-modules/commands.nix;
lantian-pre-commit-hooks = importApply ./flake-modules/lantian-pre-commit-hooks.nix {
inherit (inputs) pre-commit-hooks-nix;
};
lantian-treefmt = importApply ./flake-modules/lantian-treefmt.nix { inherit (inputs) treefmt-nix; };
nixpkgs-options = ./flake-modules/nixpkgs-options.nix;
};
pkgsForSystem-24_05 =
system:
import inputs.nixpkgs-24_05 {
inherit system;
config = {
inherit (config.nixpkgs-options) allowUnfree;
inherit (config.nixpkgs-options) permittedInsecurePackages;
};
};
in
rec {
imports = [
./flake-modules/_internal/ci-outputs.nix
./flake-modules/_internal/commands.nix
./flake-modules/_internal/meta.nix
./flake-modules/_internal/modules-test-nixos-config.nix
flakeModules.commands
flakeModules.lantian-pre-commit-hooks
flakeModules.lantian-treefmt
flakeModules.nixpkgs-options
];
systems = [
"x86_64-linux"
"aarch64-linux"
];
flake = {
overlay = self.overlays.default;
overlays =
{
default =
final: prev:
let
_packages = import ./pkgs null {
pkgs = prev;
pkgs-24_05 = pkgsForSystem-24_05 final.system;
inherit inputs;
};
_legacyPackages = import ./pkgs "legacy" {
pkgs = prev;
pkgs-24_05 = pkgsForSystem-24_05 final.system;
inherit inputs;
};
in
_packages
// rec {
# Integrate to nixpkgs python3Packages
python = prev.python.override {
packageOverrides = _final: _prev: _legacyPackages.python3Packages;
};
python3 = prev.python3.override {
packageOverrides = _final: _prev: _legacyPackages.python3Packages;
};
python3Packages = python3.pkgs;
};
inSubTree = final: prev: {
nur-xddxdd = import ./pkgs null {
pkgs = prev;
pkgs-24_05 = pkgsForSystem-24_05 final.system;
inherit inputs;
};
};
inSubTree-pinnedNixpkgs = final: _prev: {
nur-xddxdd = self.legacyPackages.${final.system};
};
inSubTree-pinnedNixpkgsWithCuda = final: _prev: {
nur-xddxdd = self.legacyPackagesWithCuda.${final.system};
};
}
// (builtins.listToAttrs (
lib.flatten (
builtins.map (s: [
{
name = "pinnedNixpkgs-${s}";
value = _final: _prev: self.legacyPackages.${s};
}
{
name = "pinnedNixpkgsWithCuda-${s}";
value = _final: _prev: self.legacyPackagesWithCuda.${s};
}
]) systems
)
));
inherit flakeModules;
nixosModules = {
setupOverlay = _: { nixpkgs.overlays = [ self.overlays.default ]; };
kata-containers = import ./modules/kata-containers.nix;
lyrica = import ./modules/lyrica.nix;
nix-cache-attic = import ./modules/nix-cache-attic.nix;
nix-cache-cachix = import ./modules/nix-cache-cachix.nix;
nix-cache-garnix = import ./modules/nix-cache-garnix.nix;
openssl-oqs-provider = import ./modules/openssl-oqs-provider.nix;
qemu-user-static-binfmt = import ./modules/qemu-user-static-binfmt.nix;
wireguard-remove-lingering-links = import ./modules/wireguard-remove-lingering-links.nix;
};
};
nixpkgs-options = {
pkgs = {
sourceInput = inputs.nixpkgs;
allowInsecurePredicate = _: true;
};
pkgsWithCuda = {
sourceInput = inputs.nixpkgs;
allowInsecurePredicate = _: true;
settings.cudaSupport = true;
};
};
perSystem =
{
pkgs,
pkgsWithCuda,
system,
...
}:
{
packages = import ./pkgs null {
inherit inputs pkgs;
pkgs-24_05 = pkgsForSystem-24_05 system;
};
packagesWithCuda = import ./pkgs null {
inherit inputs;
pkgs = pkgsWithCuda;
pkgs-24_05 = pkgsForSystem-24_05 system;
};
legacyPackages = import ./pkgs "legacy" {
inherit inputs pkgs;
pkgs-24_05 = pkgsForSystem-24_05 system;
};
legacyPackagesWithCuda = import ./pkgs "legacy" {
inherit inputs;
pkgs = pkgsWithCuda;
pkgs-24_05 = pkgsForSystem-24_05 system;
};
};
}
);
}