From 11439af3c256a1b23605461f28267e54adbd0076 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 7 Nov 2022 15:50:57 +0100 Subject: [PATCH] feat: add nix flake --- default.nix | 9 ------- flake.lock | 41 ++++++++++++++++++++++++++++++++ flake.nix | 50 +++++++++++++++++++++++++++++++++++++++ src-tauri/tauri.conf.json | 2 +- 4 files changed, 92 insertions(+), 10 deletions(-) delete mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/default.nix b/default.nix deleted file mode 100644 index 74a4503..0000000 --- a/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs ? import {} -}: -pkgs.mkShell { - name="electron-dev"; - buildInputs = [ - pkgs.electron - ]; -} - diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..787e124 --- /dev/null +++ b/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1667669848, + "narHash": "sha256-nD2dk2A+1zUlUT18ppDFVWwimi26+ultc2QRsulQwQ8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1f3ebb2bd1a353a42e8f833895c26d8415c7b791", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f3f068f --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + libraries = with pkgs;[ + webkitgtk + gtk3 + cairo + gdk-pixbuf + glib.out + dbus.lib + openssl_3.out + ]; + + packages = with pkgs; [ + curl + wget + pkg-config + dbus + openssl_3 + glib + gtk3 + libsoup + webkitgtk + cargo + ]; + in + { + devShell = pkgs.mkShell { + buildInputs = packages; + + shellHook = + let + joinLibs = libs: builtins.concatStringsSep ":" (builtins.map (x: "${x}/lib") libs); + libs = joinLibs libraries; + in + '' + export LD_LIBRARY_PATH=${libs}:$LD_LIBRARY_PATH + ''; + }; + }); +} + diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index ead92d8..ba86a0d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -2,7 +2,7 @@ "build": { "beforeBuildCommand": "", "beforeDevCommand": "", - "devPath": "http://localhost:3000", + "devPath": "http://localhost:4173", "distDir": "../frontend" }, "package": {