forked from nesto-software/openvpn3-applet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
51 lines (44 loc) · 1.51 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
51
{
description = "OpenVPN 3 Indicator for the Systray";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, nur }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
# Provide some binary packages for selected system types.
packages = forAllSystems
(system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
openvpn3-applet = pkgs.stdenv.mkDerivation
{
name = "openvpn3-applet";
src = ./.;
nativeBuildInputs = [
pkgs.makeWrapper
];
installPhase = ''
install -d $out
install -d $out/bin
install -d $out/share/applications
cp -R src/ $out
NESTO_BIN_PATH=$out/bin/openvpn3applet
makeWrapper "$out/src/openvpn3applet.sh" "$NESTO_BIN_PATH" \
--inherit-argv0 \
--prefix PATH : ${pkgs.lib.makeBinPath [
pkgs.yad
]}
sed "s#@execPath@#$NESTO_BIN_PATH#" xdg-config/autostart/openvpn3-applet.desktop.in > $out/share/applications/openvpn3-applet.desktop
'';
};
}
);
defaultPackage = forAllSystems (system: self.packages.${system}.openvpn3-applet);
};
}