Files
att_wm/nix/package.nix
2026-07-26 20:47:19 +02:00

74 lines
1.7 KiB
Nix

{
lib,
self,
stdenv,
callPackage,
zig,
pkg-config,
wayland,
wayland-protocols,
wayland-scanner,
libxkbcommon,
# Path to a replacement src/config.zig. dwm-style compile-time configuration:
# att_wm.override { configFile = ./my-config.zig; }
# Deliberately not called `config`: callPackage would fill that from the
# nixpkgs config set.
configFile ? null,
}:
let
deps = callPackage ./deps.nix { };
in
stdenv.mkDerivation {
pname = "att_wm";
version = "0.1.0";
src = lib.cleanSource self;
strictDeps = true;
nativeBuildInputs = [
zig
pkg-config
wayland-scanner
];
buildInputs = [
wayland
wayland-protocols
wayland-scanner
libxkbcommon
];
zigBuildFlags = [
"--system"
"${deps}"
"-Dpie"
]
++ lib.optional (configFile != null) "-Dconfig=${configFile}";
doCheck = true;
# The check phase gets its own flag list, so it needs --system too; without
# it `zig build test` tries to fetch the dependencies over the network and
# fails in the sandbox.
zigCheckFlags = [
"--system"
"${deps}"
];
meta = {
description = "A dwm-like window manager for the river Wayland compositor";
longDescription = ''
att_wm implements river-window-management-v1, providing dwm's window
management model tags, a master/stack layout, monocle and tabbed
layouts on top of river 0.4's non-monolithic compositor. Tag and window
state is published over a JSON-lines unix socket for bars such as
quickshell, and driven back the other way with the att_wmctl CLI.
'';
license = lib.licenses.gpl3Only;
platforms = lib.platforms.linux;
mainProgram = "att_wm";
};
}