From 1c63afc4dca6c01f657114281aacc184d5465a71 Mon Sep 17 00:00:00 2001 From: networkException Date: Wed, 28 Aug 2024 15:24:08 +0200 Subject: [PATCH] nix: add support for building using nix This patch adds a default nix which invokes a `callPackage` to build sources from the current working directory. To invoke the build run `nix-build`. --- default.nix | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..c8c4010 --- /dev/null +++ b/default.nix @@ -0,0 +1,56 @@ +{ pkgs ? import {} }: let + package = { + rustPlatform, + nix-gitignore, + pkg-config, + openssl, + glib, + gdk-pixbuf, + graphene, + cairo, + pango, + gtk4, + libsoup_3, + libadwaita, + webkitgtk_6_0, + libseccomp, + wrapGAppsHook4, + glib-networking, + }: rustPlatform.buildRustPackage { + pname = "paket"; + version = "unstable-2024-08-28"; + + src = nix-gitignore.gitignoreSource [] ./.; + + cargoLock.lockFile = ./Cargo.lock; + + nativeBuildInputs = [ + pkg-config + graphene + cairo + wrapGAppsHook4 + ]; + + buildInputs = [ + # Building + openssl + glib + gdk-pixbuf + pango + gtk4 + libsoup_3 + libadwaita + webkitgtk_6_0 # for JSC + + # Linking + libseccomp + + # Runtime + glib-networking + ]; + + meta = { + mainProgram = "packet"; + }; + }; +in pkgs.callPackage package { }