mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-09-19 16:49:04 +05:30
feat(packages): add omasnap
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{inputs, ...}: {
|
{inputs, ...}: {
|
||||||
flake.overlays = {
|
flake.overlays = {
|
||||||
modifications = final: prev: {
|
modifications = final: prev: {
|
||||||
|
omasnap = prev.callPackage ../../packages/omasnap.nix {};
|
||||||
tnvim = inputs.tnvim.packages.${prev.stdenv.hostPlatform.system}.default;
|
tnvim = inputs.tnvim.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
tshell = inputs.tshell.packages.${prev.stdenv.hostPlatform.system}.default;
|
tshell = inputs.tshell.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
trok = inputs.trok.packages.${prev.stdenv.hostPlatform.system}.default;
|
trok = inputs.trok.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
@@ -27,10 +28,14 @@
|
|||||||
copyparty = inputs.copyparty.overlays.default;
|
copyparty = inputs.copyparty.overlays.default;
|
||||||
};
|
};
|
||||||
|
|
||||||
perSystem = {system, ...}: {
|
perSystem = {system, ...}: let
|
||||||
_module.args.pkgs = import inputs.nixpkgs {
|
pkgs = import inputs.nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = builtins.attrValues inputs.self.overlays;
|
overlays = builtins.attrValues inputs.self.overlays;
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
_module.args.pkgs = pkgs;
|
||||||
|
|
||||||
|
packages.omasnap = pkgs.omasnap;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
hyprshot
|
hyprshot
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
wl-screenrec
|
wl-screenrec
|
||||||
|
omasnap
|
||||||
(writeShellScriptBin "hypr-screenshot" ''
|
(writeShellScriptBin "hypr-screenshot" ''
|
||||||
hyprshot -m region -r ppm - | satty --filename -
|
hyprshot -m region -r ppm - | satty --filename -
|
||||||
'')
|
'')
|
||||||
|
|||||||
68
packages/omasnap.nix
Normal file
68
packages/omasnap.nix
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
cmake,
|
||||||
|
fetchFromGitHub,
|
||||||
|
hyprland,
|
||||||
|
kdePackages,
|
||||||
|
ninja,
|
||||||
|
pkg-config,
|
||||||
|
tesseract,
|
||||||
|
wayland,
|
||||||
|
wayland-protocols,
|
||||||
|
wayland-scanner,
|
||||||
|
wl-clipboard,
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "omasnap";
|
||||||
|
version = "v1.20.1";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "omacom";
|
||||||
|
repo = "omasnap";
|
||||||
|
rev = "d339588f3aba554f314d6233da2dddc98f83de55";
|
||||||
|
hash = "sha256-90p1lZDj4cksAAhpbJMQwN6cMqqcZyRVESMLpjmw294=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace CMakeLists.txt \
|
||||||
|
--replace-fail "/usr/share/wayland-protocols" \
|
||||||
|
"${wayland-protocols}/share/wayland-protocols"
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
kdePackages.wrapQtAppsHook
|
||||||
|
ninja
|
||||||
|
pkg-config
|
||||||
|
wayland-scanner
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
kdePackages.layer-shell-qt
|
||||||
|
kdePackages.qtbase
|
||||||
|
wayland
|
||||||
|
wayland-protocols
|
||||||
|
];
|
||||||
|
|
||||||
|
cmakeFlags = [(lib.cmakeBool "BUILD_TESTING" false)];
|
||||||
|
|
||||||
|
qtWrapperArgs = [
|
||||||
|
"--prefix"
|
||||||
|
"PATH"
|
||||||
|
":"
|
||||||
|
(lib.makeBinPath [
|
||||||
|
hyprland
|
||||||
|
tesseract
|
||||||
|
wl-clipboard
|
||||||
|
])
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Fast Wayland screenshot and annotation overlay for Hyprland";
|
||||||
|
homepage = "https://github.com/omacom/omasnap";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
mainProgram = "omasnap";
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user