Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions flake.lock

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

27 changes: 14 additions & 13 deletions nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
lib,
stdenv,
rustPlatform,
rustc,
cargo,
makeDesktopItem,
}: let
pname = "defguard-client";
Expand All @@ -17,7 +19,7 @@
categories = ["Network" "Security"];
};

rustToolchain = pkgs.rust-bin.stable.latest.default;
pnpm = pkgs.pnpm_10;

buildInputs = with pkgs; [
at-spi2-atk
Expand All @@ -38,22 +40,21 @@
desktop-file-utils
];

nativeBuildInputs = with pkgs; [
rustToolchain
pkg-config
gobject-introspection
cargo-tauri
nodejs_24
protobuf
nativeBuildInputs = [
rustc
cargo
pkgs.pkg-config
pkgs.gobject-introspection
pkgs.cargo-tauri
pkgs.nodejs_24
pkgs.protobuf
pnpm
# configures pnpm to use pre-fetched dependencies
pnpm.configHook
# configures cargo to use pre-fetched dependencies
rustPlatform.cargoSetupHook
# perl
wrapGAppsHook
# helper to add dynamic library paths
makeWrapper
pkgs.makeWrapper
];
in
stdenv.mkDerivation (finalAttrs: rec {
Expand All @@ -79,7 +80,7 @@ in
;

fetcherVersion = 2;
hash = "sha256-GlgQuPpOibPrItt6X9EqV4QmCOyajZh5yy7gHh+O+ME=";
hash = "sha256-QgHFIJv7BwzRQAzJ30+GhD5lCwVgASM0MwSwlRBWL4I=";
};

buildPhase = ''
Expand All @@ -99,7 +100,7 @@ in

# add required library to client binary RPATH
wrapProgram $out/bin/${pname} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [pkgs.libayatana-appindicator]}
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [pkgs.libayatana-appindicator pkgs.desktop-file-utils]}

mkdir -p $out/share/applications
cp ${desktopItem}/share/applications/* $out/share/applications/
Expand Down
13 changes: 12 additions & 1 deletion nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
targets = ["x86_64-apple-darwin" "aarch64-apple-darwin" "x86_64-pc-windows-gnu"];
};

defguard-client = pkgs.callPackage ./package.nix {};
# share custom toolchain with package
rustPlatform = pkgs.makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
};

defguard-client = pkgs.callPackage ./package.nix {
inherit rustPlatform;
cargo = rustToolchain;
rustc = rustToolchain;
};

# runtime libraries needed to run the dev server
libraries = with pkgs; [
Expand All @@ -18,6 +28,7 @@ in

# add additional dev tools
packages = with pkgs; [
rustToolchain
trunk
sqlx-cli
vtsls
Expand Down