diff --git a/flake.lock b/flake.lock index b10558f0..5000e7ba 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1758213207, - "narHash": "sha256-rqoqF0LEi+6ZT59tr+hTQlxVwrzQsET01U4uUdmqRtM=", + "lastModified": 1758446476, + "narHash": "sha256-5rdAi7CTvM/kSs6fHe1bREIva5W3TbImsto+dxG4mBo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f4b140d5b253f5e2a1ff4e5506edbf8267724bde", + "rev": "a1f79a1770d05af18111fbbe2a3ab2c42c0f6cd0", "type": "github" }, "original": { @@ -60,11 +60,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1758249250, - "narHash": "sha256-bg228atm49IZ8koNOlT3bsrFKE9sFjq6vn6Tx8eVgpc=", + "lastModified": 1758681214, + "narHash": "sha256-8cW731vev6kfr58cILO2ZsjHwaPhm88dQ8Q6nTSjP9I=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "e26a009e7edab102bd569dc041459deb6c0009f4", + "rev": "b12ed88d8d33d4f3cbc842bf29fad93bb1437299", "type": "github" }, "original": { diff --git a/nix/package.nix b/nix/package.nix index cad9c48b..a0ff6e31 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -3,6 +3,8 @@ lib, stdenv, rustPlatform, + rustc, + cargo, makeDesktopItem, }: let pname = "defguard-client"; @@ -17,7 +19,7 @@ categories = ["Network" "Security"]; }; - rustToolchain = pkgs.rust-bin.stable.latest.default; + pnpm = pkgs.pnpm_10; buildInputs = with pkgs; [ at-spi2-atk @@ -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 { @@ -79,7 +80,7 @@ in ; fetcherVersion = 2; - hash = "sha256-GlgQuPpOibPrItt6X9EqV4QmCOyajZh5yy7gHh+O+ME="; + hash = "sha256-QgHFIJv7BwzRQAzJ30+GhD5lCwVgASM0MwSwlRBWL4I="; }; buildPhase = '' @@ -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/ diff --git a/nix/shell.nix b/nix/shell.nix index 3de733fd..34c2be3a 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -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; [ @@ -18,6 +28,7 @@ in # add additional dev tools packages = with pkgs; [ + rustToolchain trunk sqlx-cli vtsls