-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathflake.nix
100 lines (92 loc) · 2.91 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
{
description = "Official Hyprland Plugins";
inputs = {
hyprland.url = "github:hyprwm/Hyprland";
nixpkgs.follows = "hyprland/nixpkgs";
systems.follows = "hyprland/systems";
};
outputs = {
self,
hyprland,
nixpkgs,
systems,
...
}: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs (import systems);
pkgsFor = eachSystem (system:
import nixpkgs {
localSystem.system = system;
overlays = [
self.overlays.hyprland-plugins
self.overlays.gcc14Stdenv
hyprland.overlays.hyprland-packages
];
});
in {
packages = eachSystem (system: {
inherit
(pkgsFor.${system}.hyprlandPlugins)
borders-plus-plus
csgo-vulkan-fix
hyprbars
hyprexpo
hyprtrails
hyprwinwrap
xtra-dispatchers
;
});
overlays = {
default = self.overlays.hyprland-plugins;
hyprland-plugins = final: prev: let
inherit (final) callPackage;
in {
hyprlandPlugins =
(prev.hyprlandPlugins
or {})
// {
borders-plus-plus = callPackage ./borders-plus-plus {};
csgo-vulkan-fix = callPackage ./csgo-vulkan-fix {};
hyprbars = callPackage ./hyprbars {};
hyprexpo = callPackage ./hyprexpo {};
hyprtrails = callPackage ./hyprtrails {};
hyprwinwrap = callPackage ./hyprwinwrap {};
xtra-dispatchers = callPackage ./xtra-dispatchers {};
};
};
# TODO: remove when https://github.com/NixOS/nixpkgs/pull/365776 lands in master
gcc14Stdenv = final: prev: {
hyprlandPlugins =
(prev.hyprlandPlugins or {})
// {
mkHyprlandPlugin = hyprland: args @ {pluginName, ...}:
hyprland.stdenv.mkDerivation (
args
// {
pname = pluginName;
nativeBuildInputs = [prev.pkg-config] ++ args.nativeBuildInputs or [];
buildInputs = [hyprland] ++ hyprland.buildInputs ++ (args.buildInputs or []);
meta =
args.meta
// {
description = args.meta.description or "";
longDescription =
(args.meta.longDescription or "")
+ "\n\nPlugins can be installed via a plugin entry in the Hyprland NixOS or Home Manager options.";
};
}
);
};
};
};
checks = eachSystem (system: self.packages.${system});
devShells = eachSystem (system:
with pkgsFor.${system}; {
default = mkShell.override {stdenv = gcc14Stdenv;} {
name = "hyprland-plugins";
buildInputs = [hyprland.packages.${system}.hyprland];
inputsFrom = [hyprland.packages.${system}.hyprland];
};
});
};
}