diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5d48cd6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1755922037, + "narHash": "sha256-wY1+2JPH0ZZC4BQefoZw/k+3+DowFyfOxv17CN/idKs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "b1b3291469652d5a2edb0becc4ef0246fff97a7c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index e2e0104..3ceb42f 100644 --- a/flake.nix +++ b/flake.nix @@ -7,33 +7,57 @@ outputs = {nixpkgs, ...}: let system = "x86_64-linux"; + enableXWayland = false; in { devShells."${system}".default = let pkgs = import nixpkgs { inherit system; }; + lib = nixpkgs.lib; + stdenv = pkgs.stdenv; in pkgs.mkShell { - packages = with pkgs; [ - # NativeBuildInputs - installShellFiles - pkg-config - wayland-scanner + packages = with pkgs; + [ + # NativeBuildInputs + installShellFiles + pkg-config + wayland-scanner - # BuildInputs - libinput - libxcb - libxkbcommon - pixman - wayland - wayland-protocols - wlroots + # BuildInputs + libinput + xorg.libxcb + libxkbcommon + pixman + wayland + wayland-protocols + wlroots_0_19 + ] + ++ lib.optionals enableXWayland + [ + # XWayland + xorg.libX11 + xorg.xcbutilwm + xwayland + ]; - # XWayland - libX11 - xcbutilwm - xwayland - ]; + 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' + ''; }; }; }