-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
50 lines (45 loc) · 1.16 KB
/
flake.nix
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
{
description = "A cross-platform CLI clipboard management utils, written in POSIX shell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }: let
forAllSystems = nixpkgs.lib.genAttrs systems;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in {
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib;
in {
default = self.packages.${system}.clip;
clip = pkgs.stdenv.mkDerivation {
name = "clip";
pname = "clip";
src = ./.;
nativeBuildInputs = with pkgs; [ makeWrapper ];
installPhase = ''
mkdir -p $out/bin
install -t $out/bin -m 755 yank put
'';
postFixup = with pkgs; ''
for bin in $out/bin/*; do
wrapProgram $bin \
--set PATH ${lib.makeBinPath [
coreutils
file
gnugrep
procps
imagemagick
wl-clipboard
]}
done
'';
};
});
};
}