Skip to content

Commit

Permalink
feat: add nix integration
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinLoeper committed Sep 12, 2023
1 parent f6e041c commit d72577b
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
41 changes: 41 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
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.yad
];
installPhase = ''
install -d $out
install -d $out/bin
install -d $out/share/applications
cp -R src/ $out
ln -s $out/src/openvpn3applet.sh $out/bin/openvpn3applet
NESTO_BIN_PATH=$out/bin/openvpn3applet
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);
};
}
7 changes: 7 additions & 0 deletions xdg-config/autostart/openvpn3-applet.desktop.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Exec=sh -c '@execPath@'
Icon=
Name=openvpn3-applet
Path=
Terminal=False
Type=Application

0 comments on commit d72577b

Please sign in to comment.