-
Notifications
You must be signed in to change notification settings - Fork 12
/
flake.nix
73 lines (68 loc) · 2.11 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
{
inputs = {
hyprland.url = "github:hyprwm/Hyprland";
};
outputs = {
self,
hyprland,
...
}: let
inherit (hyprland.inputs) nixpkgs;
eachSystem = nixpkgs.lib.genAttrs (import hyprland.inputs.systems);
pkgsFor = eachSystem (system: import nixpkgs {localSystem = system;});
rawCommitPins = (builtins.fromTOML (builtins.readFile ./hyprpm.toml)).repository.commit_pins;
commitPins = builtins.listToAttrs (
map (p: {
name = builtins.head p;
value = builtins.elemAt p 1;
})
rawCommitPins
);
srcRev = "${commitPins.${hyprland.rev} or "git"}";
srcRevShort = builtins.substring 0 7 srcRev;
in {
packages = eachSystem (system: let
pkgs = pkgsFor.${system};
in rec {
hyprsplit = pkgs.stdenv.mkDerivation {
pname = "hyprsplit";
version = "flakeRev=${self.shortRev or "dirty"}_srcRev=${srcRevShort}";
src =
if (commitPins ? ${hyprland.rev}) && (self ? rev)
then
(builtins.fetchGit {
url = "https://github.com/shezdy/hyprsplit";
rev = srcRev;
})
else ./.;
nativeBuildInputs = with pkgs; [pkg-config meson ninja gcc14];
buildInputs = with pkgs;
[
hyprland.packages.${system}.hyprland.dev
pixman
libdrm
]
++ hyprland.packages.${system}.hyprland.buildInputs;
meta = with pkgs.lib; {
homepage = "https://github.com/shezdy/hyprsplit";
description = "Hyprland plugin for separate sets of workspaces on each monitor";
license = licenses.bsd3;
platforms = platforms.linux;
};
};
default = hyprsplit;
});
devShells = eachSystem (system: let
pkgs = pkgsFor.${system};
in {
default = pkgs.mkShell.override {stdenv = pkgs.gcc14Stdenv;} {
shellHook = ''
meson setup build --reconfigure
cp ./build/compile_commands.json ./compile_commands.json
'';
name = "hyprsplit";
inputsFrom = [self.packages.${system}.hyprsplit];
};
});
};
}