-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
178 lines (170 loc) · 5.56 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
{
description = "A1ca7raz's Nix User Repo";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-23-05.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
# Dependencies of 3rd-party flakes
nixpkgs-lib.url = "github:NixOS/nixpkgs/nixos-unstable?dir=lib";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs-lib";
};
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
hercules-ci-effects = {
url = "github:hercules-ci/hercules-ci-effects";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
# Packages from other flakes
# FIXME: rollback sops-nix to fix breaking changes
sops-nix = {
url = "github:Mic92/sops-nix/59d6988329626132eaf107761643f55eb979eef1";
inputs.nixpkgs.follows = "nixpkgs";
};
# nvfetcher = {
# url = "github:berberman/nvfetcher";
# inputs.nixpkgs.follows = "nixpkgs";
# inputs.flake-utils.follows = "flake-utils";
# inputs.flake-compat.follows = "flake-compat";
# };
spicetify-nix = {
url = "github:A1ca7raz/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-parts.follows = "flake-parts";
inputs.crane.follows = "crane";
inputs.rust-overlay.follows = "rust-overlay";
inputs.pre-commit-hooks-nix.follows = "";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpak = {
url = "github:nixpak/nixpak";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
inputs.hercules-ci-effects.follows = "hercules-ci-effects";
};
};
outputs = inputs@{ self, nixpkgs, flake-utils, nixpak, ... }:
let
inherit (import ./config.nix)
extraPackages
jetbrainsPackages;
lib = nixpkgs.lib;
utils = import ./lib lib;
system = [ "x86_64-linux" ];
overlay = import ./overlay.nix lib;
in
flake-utils.lib.eachSystem system (system:
let
pkgs = import nixpkgs {
config.allowUnfree = true;
inherit system;
overlays = [
overlay
self.overlays.nixpaks
# nvfetcher.overlays.default
];
};
nurpkgs = import ./. { inherit pkgs lib; };
inherit (pkgs) mkShell;
mkNixPak = nixpak.lib.nixpak {
inherit (pkgs) lib;
inherit pkgs;
};
nixpakPackages = utils.mapPackages (
name: vaule:
(mkNixPak {
config = vaule;
}).config.env
) "function" ./pkgs/_nixpaks;
# Groups of nur packages
customPackages = flake-utils.lib.filterPackages pkgs.system (nurpkgs);
unfreePackages = extraPackages pkgs;
# nvfetcherPackages = nvfetcher.packages.${system};
sopsPackages = inputs.sops-nix.packages.${system};
spicetifyPackages = {
spicetifyAll = inputs.spicetify-nix.checks.${system}.all-tests;
spicetifyApps = inputs.spicetify-nix.checks.${system}.apps;
};
lanzabootePackages = inputs.lanzaboote.packages.${system};
nixIndexDbPackages = inputs.nix-index-database.packages.${system};
JetBrainsPackages = jetbrainsPackages pkgs;
in rec {
legacyPackages = customPackages //
unfreePackages //
sopsPackages //
# nvfetcherPackages //
spicetifyPackages //
lanzabootePackages //
nixIndexDbPackages //
JetBrainsPackages //
nixpakPackages;
packages = legacyPackages;
packageBundles = utils.mkPackageBundles pkgs ./pkgs // {
inherit
unfreePackages
customPackages
# nvfetcherPackages
sopsPackages
spicetifyPackages
nixIndexDbPackages
JetBrainsPackages
nixpakPackages;
ciPackages = sopsPackages;
trivialPackages = spicetifyPackages //
lanzabootePackages //
nixIndexDbPackages;
};
checks = legacyPackages;
formatter = pkgs.nixpkgs-fmt;
devShells.default = mkShell {
nativeBuildInputs = with pkgs; [
nvfetcher
nix-init
];
};
apps.update = {
type = "app";
program = (pkgs.writeShellScript "script" ''
${pkgs.nvfetcher}/bin/nvfetcher -o pkgs/_sources "$@"
'').outPath;
};
}
) // {
overlay = self.overlays.default;
overlays.default = overlay;
overlays.nixpaks = final: prev: {
nixpaks = self.packageBundles.nixpakPackages;
};
# overlays.nvfetcher = nvfetcher.overlays.default;
nixosModule = self.nixosModules.default;
nixosModules.default = { ... }: {
imports = utils.importsDirs ./modules;
nixpkgs.overlays = [
self.overlays.default
# self.overlays.nvfetcher
];
nix.settings = import ./substituters.nix;
};
};
}