-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathflake.nix
More file actions
99 lines (84 loc) · 2.49 KB
/
flake.nix
File metadata and controls
99 lines (84 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
description = "Polished screenshot utility for Hyprland built with Quickshell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems =
f: nixpkgs.lib.genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
# Define runtime dependencies once
runtimeDeps =
pkgs: with pkgs; [
quickshell
grim
imagemagick
wl-clipboard
satty
libnotify
];
in
{
overlays.default = final: prev: {
hyprquickframe = self.packages.${final.system}.default;
};
packages = forAllSystems (pkgs: {
default = pkgs.stdenv.mkDerivation {
pname = "hyprquickframe";
version = "0.1.0";
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter =
path: type:
let
baseName = baseNameOf path;
in
!(builtins.elem baseName [
"flake.nix"
"flake.lock"
".git"
".gitignore"
"README.md"
"LICENSE"
]);
};
nativeBuildInputs = with pkgs; [
makeWrapper
qt6.wrapQtAppsHook
];
buildInputs = with pkgs; [
qt6.qt5compat
];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/share/hyprquickframe
cp -r . $out/share/hyprquickframe/
mkdir -p $out/bin
makeWrapper ${pkgs.quickshell}/bin/quickshell $out/bin/hyprquickframe \
--prefix PATH : ${pkgs.lib.makeBinPath (runtimeDeps pkgs)} \
--add-flags "-c $out/share/hyprquickframe -n"
runHook postInstall
'';
meta = with pkgs.lib; {
description = "Quickshell-based screenshot utility for Hyprland";
homepage = "https://github.com/Ronin-CK/HyprQuickFrame";
license = licenses.mit;
platforms = platforms.linux;
mainProgram = "hyprquickframe";
};
};
});
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
buildInputs = runtimeDeps pkgs;
};
});
};
}