crywl/flake.nix

64 lines
1.5 KiB
Nix
Raw Normal View History

2025-08-25 15:01:50 +10:00
{
description = "DWL Development Shell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
};
outputs = {nixpkgs, ...}: let
system = "x86_64-linux";
enableXWayland = false;
2025-08-25 15:01:50 +10:00
in {
devShells."${system}".default = let
pkgs = import nixpkgs {
inherit system;
};
lib = nixpkgs.lib;
stdenv = pkgs.stdenv;
2025-08-25 15:01:50 +10:00
in
pkgs.mkShell {
packages = with pkgs;
[
# NativeBuildInputs
installShellFiles
pkg-config
wayland-scanner
2025-08-25 15:01:50 +10:00
# BuildInputs
libinput
xorg.libxcb
libxkbcommon
pixman
wayland
wayland-protocols
wlroots_0_19
]
++ lib.optionals enableXWayland
[
# XWayland
xorg.libX11
xorg.xcbutilwm
xwayland
];
2025-08-25 15:01:50 +10:00
shellHook = let
makeFlags =
lib.strings.concatStringsSep " "
([
"PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
"WAYLAND_SCANNER=wayland-scanner"
# "PREFIX=$(out)"
# "MANDIR=$(man)/share/man"
]
++ lib.optionals enableXWayland [
''XWAYLAND="-DXWAYLAND"''
''XLIBS="xcb xcb-icccm"''
]);
in ''
TERM=xterm-256color
alias mk='${makeFlags} make'
'';
2025-08-25 15:01:50 +10:00
};
};
}