vellum: init at 0.6.0, nixos/vellum: init module (#552415)

This commit is contained in:
h7x4
2026-08-21 19:26:25 +00:00
committed by GitHub
4 changed files with 157 additions and 0 deletions

View File

@@ -84,6 +84,8 @@
- [Krill](https://nlnetlabs.nl/projects/krill/about), RPKI CA and Publication Server written in Rust. Available as [services.krill](#opt-services.krill.enable).
- [vellum](https://github.com/greyxp1/vellum) is a live screen annotation overlay for Wayland. Available as [programs.vellum](#opt-programs.vellum.enable).
- [stash-clipboard](https://github.com/NotAShelf/stash), a Wayland clipboard "manager" with fast persistent history and multi-media support. Available as [services.stash-clipboard](#opt-services.stash-clipboard.enable).
- [OO7](https://github.com/linux-credentials/oo7) is a desktop-agnostic Secret Service provider. Available as [services.oo7](#opt-services.oo7.enable)

View File

@@ -352,6 +352,7 @@
./programs/udevil.nix
./programs/upki.nix
./programs/usbtop.nix
./programs/vellum.nix
./programs/vim.nix
./programs/virt-manager.nix
./programs/vivid.nix

View File

@@ -0,0 +1,81 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.vellum;
inherit (lib)
getExe
literalExpression
mkEnableOption
mkIf
mkOption
mkPackageOption
;
inherit (lib.types) separatedString;
toml = pkgs.formats.toml { };
in
{
options.programs.vellum = {
enable = mkEnableOption "vellum, a live screen annotation overlay for Wayland";
package = mkPackageOption pkgs "vellum" { };
settings = mkOption {
inherit (toml) type;
default = { };
description = ''
Configuration options for vellum.
See available options at <https://github.com/greyxp1/vellum/blob/master/docs/configuration.md>.
'';
example = literalExpression ''
{
default_tool = "arrow";
remember_last_tool = false;
feedback_duration_ms = 250;
}
'';
};
extraOptions = mkOption {
type = separatedString " ";
default = "";
description = ''
Extra command-line options to pass to
the {command}`vellum` daemon.
'';
example = "--force-backend vulkan";
};
};
config = mkIf cfg.enable {
environment = {
systemPackages = [ cfg.package ];
etc."xdg/vellum/config.toml" = mkIf (cfg.settings != { }) {
source = toml.generate "vellum-config.toml" cfg.settings;
};
};
systemd.user.services.vellum = {
description = "Vellum screen annotation overlay";
after = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ];
restartTriggers = [ config.environment.etc."xdg/vellum/config.toml".source ];
serviceConfig = {
ExecStart = "${getExe cfg.package} ${cfg.extraOptions}";
Restart = "on-failure";
};
};
};
meta = {
maintainers = with lib.maintainers; [ poz ];
};
}

View File

@@ -0,0 +1,73 @@
{
fetchFromGitHub,
installShellFiles,
lib,
libGL,
libxkbcommon,
makeBinaryWrapper,
pkg-config,
rustPlatform,
versionCheckHook,
vulkan-loader,
wayland,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "vellum";
version = "0.6.0";
src = fetchFromGitHub {
owner = "greyxp1";
repo = "vellum";
tag = "v${finalAttrs.version}";
hash = "sha256-uWGaCeENwaqg2+wbtfgpDAjxIsJbgUcMnvSPauwjcBI=";
};
cargoHash = "sha256-quZW6jkGzvRHNgkJQS4entJyXeYftBOV89hKaFfQCDw=";
__structuredAttrs = true;
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
pkg-config
];
buildInputs = [
libxkbcommon
wayland
];
postInstall = ''
manDir=$(find target -type d -path '*/build/vellum-*/out/man' -print -quit)
installManPage "$manDir"/*.1
wrapProgram $out/bin/vellum \
--prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [
libGL
vulkan-loader
wayland
]
}
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
meta = {
description = "Live screen annotation overlay for Wayland";
homepage = "https://github.com/greyxp1/vellum";
changelog = "https://github.com/greyxp1/vellum/releases/tag/v${finalAttrs.version}";
downloadPage = "https://github.com/greyxp1/vellum/releases";
license =
with lib.licenses;
AND [
isc
mit
];
maintainers = with lib.maintainers; [ poz ];
platforms = lib.platforms.linux;
mainProgram = "vellum";
};
})