final changes

This commit is contained in:
elwrcl committed 2026-10-09 15:08:50 +03:00
1 parent 42bca37ed8
commit 2028a9aaa7
8 files changed
+24 -91

No files matched your search

-15
View File
@@ -9,9 +9,6 @@
}:
let
valw = self'.packages.default;
# The home-manager module, evaluated with stand-ins for the two
# home-manager options it sets (no home-manager input needed).
homeModule =
valwConfig:
(lib.evalModules {
@@ -44,7 +41,6 @@
];
}).config;
# Reuses the package's vendored dependencies, runs `cmd` instead of the build.
cargoCheck =
name: tools: cmd:
valw.overrideAttrs (old: {
@@ -52,7 +48,6 @@
nativeBuildInputs = old.nativeBuildInputs ++ tools;
buildPhase = cmd;
installPhase = "touch $out";
# The package patches its binary's RUNPATH; a check has no binary.
postFixup = "";
});
in
@@ -100,9 +95,6 @@
}/testBuildFailure.log
touch $out
'';
# The plugin as packaged: manifest, every entry present, Luau that
# compiles, translations that parse; and its logic against stubbed
# Noctalia globals.
noctalia-plugin =
pkgs.runCommand "valw-noctalia-plugin"
{
@@ -135,8 +127,6 @@
touch $out
'';
# Runs the real screencopy path against a headless sway. This is
# wlroots, not niri, but it catches capture and format bugs on every build.
headless =
pkgs.runCommand "valw-headless"
{
@@ -168,15 +158,10 @@
valw doctor | tee doctor.txt
! grep -q '^fail' doctor.txt
# Through a pipe: the clipboard child must not keep it open.
# The timeout covers the reader too; the child is in its own
# session, so bounding valw alone would not catch a leak.
timeout 10 sh -c 'valw screen -o - | cat > shot.png'
file shot.png | tee file.txt
grep -q 'PNG image data, 1280 x 720' file.txt
# Preview. The background is solid black, so a thumbnail in the
# bottom-right corner shows up as more than one colour there.
mkdir -p $HOME/.config/valw
printf '[preview]\ntimeout_secs = 2\n' > $HOME/.config/valw/config.toml
socket=$XDG_RUNTIME_DIR/valw.sock
-4
View File
@@ -16,21 +16,17 @@
clippy
rust-analyzer
rustfmt
# Manual verification: grim is the pixel oracle, magick compares.
grim
imagemagick
wayland-utils
];
# What the package gets through its RUNPATH, for `cargo run`.
LD_LIBRARY_PATH = lib.makeLibraryPath [
pkgs.wayland
pkgs.libxkbcommon
pkgs.libglvnd
];
# The repo is a path: flake, so Nix copies the whole tree on every
# evaluation. Keep the multi-gigabyte target dir out of it.
shellHook = ''
export CARGO_TARGET_DIR="''${XDG_CACHE_HOME:-$HOME/.cache}/valw/target"
'';
-1
View File
@@ -10,7 +10,6 @@
let
cfg = config.programs.valw;
toml = pkgs.formats.toml { };
# valw checks its own config: a typo or a bad value fails the build.
checked =
settings:
let
+1 -10
View File
@@ -14,9 +14,7 @@
!(builtins.elem (baseNameOf path) [
".direnv"
".jj"
# Plan ledgers and review notes; not part of the build.
".superpowers"
# Documentation: a doc change shouldn't rebuild the binary.
"docs"
"README.md"
"result"
@@ -35,11 +33,7 @@
pkgs.wayland
];
# Tests run through `nix flake check` instead.
doCheck = false;
# Clicking a preview opens Satty if configured. --suffix keeps a user's own Satty first.
# The editor embeds DejaVu Sans Bold; its licence wants the notice shipped.
postInstall = ''
wrapProgram $out/bin/valw --suffix PATH : ${
lib.makeBinPath [
@@ -48,14 +42,11 @@
]
}
install -Dm644 assets/fonts/LICENSE-DejaVu $out/share/licenses/valw/LICENSE-DejaVu
# The Noctalia plugin (programs.valw.noctalia), without its tests.
mkdir -p $out/share/valw
cp -r noctalia-plugin $out/share/valw/noctalia-plugin
rm -r $out/share/valw/noctalia-plugin/tests
'';
# dlopen()ed at run time: libwayland (winit, valw), libxkbcommon (winit),
# libEGL (zoom, editor; Mesa's drivers come from the system).
postFixup = ''
patchelf --add-rpath ${
lib.makeLibraryPath [
@@ -67,7 +58,7 @@
'';
meta = {
description = "macOS-style screenshots for niri";
description = "desktop helper";
mainProgram = "valw";
platforms = lib.platforms.linux;
};