-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathflake.nix
More file actions
110 lines (98 loc) · 3.19 KB
/
flake.nix
File metadata and controls
110 lines (98 loc) · 3.19 KB
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
{
description = "A Wayland compositor written in Haskell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
# Required by `shell.nix`.
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
flake-utils.url = "github:numtide/flake-utils";
nix-github-actions.url = "github:nix-community/nix-github-actions";
nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, nix-github-actions, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages = pkgs.haskellPackages.override {
overrides = hself: hsuper: {
wlhs-bindings = hself.callCabal2nix "wlhs-bindings" ./wlhs { };
tiny-wlhs = hself.callCabal2nix "tiny-wlhs" ./. {
inherit (pkgs) libxkbcommon;
};
};
};
in
{
packages.default = haskellPackages.tiny-wlhs;
githubActions = nix-github-actions.lib.mkGithubMatrix {
checks = {
x86_64-linux = {
tiny-wlhs = self.packages.${system}.default;
};
};
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
wayland
wayland-protocols
wayland-scanner
wlroots
wlr-protocols
pixman
libxkbcommon
libffi
libdrm
egl-wayland
libGL
mesa
vulkan-loader
pkg-config
libudev-zero
systemdLibs
libdisplay-info
libliftoff
libinput
xorg.libxcb
xorg.libXau
xorg.libXdmcp
xorg.xcbutilrenderutil
xorg.xcbutilwm
xorg.xcbutilerrors
# Development tools
bear
gdb
haskell-language-server
haskellPackages.fourmolu
clang-tools
# Example Wayland Clients
yambar
mako
bemenu
swaybg # formerly, this line was `wbg`
# Build tools
gcc
gnumake
libseat
ghc
cabal-install
];
shellHook = ''
export WAYLAND_PROTOCOLS=${pkgs.wayland-protocols}/share/wayland-protocols
export WLR_PROTOCOLS=${pkgs.wlr-protocols}/share/wlr-protocols/
export WAYLAND_SCANNER=${pkgs.wayland-scanner}/bin/wayland-scanner
export WLR_RENDERER=pixman
export BEMENU_OPTS="-i -l 10 --fn 'monospace 12' --tb '#1d1f21' --tf '#c5c8c6' --fb '#1d1f21' --ff '#c5c8c6' --nb '#1d1f21' --nf '#c5c8c6' --hb '#1d1f21' --hf '#81a2be'"
export BEMENU_BACKEND=wayland
unset GHC_PACKAGE_PATH
# Build tinywl
echo "Building tinywl..."
cd tinywl
make -f Makefile.shared clean
make -f Makefile.shared
cd ..
# Add the tinywl directory to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/tinywl
'';
};
}
);
}