From ac991333022f7d35103c05d4ae379875d3896a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Thu, 10 Oct 2024 13:59:43 +0200 Subject: [PATCH] build with flake --- .gitignore | 1 + flake.nix | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 09b74c7..591e53b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target .envrc .direnv +/result diff --git a/flake.nix b/flake.nix index 976dc75..dd5fbfc 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,6 @@ url = "github:oxalica/rust-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; }; }; }; @@ -14,6 +13,9 @@ flake-utils.lib.eachDefaultSystem (system: let + pname = "vikunja-gatherer"; + version = "0.1.0"; + src = ./.; overlays = [ (import rust-overlay) ]; pkgs = import nixpkgs { inherit system overlays; @@ -23,11 +25,21 @@ with pkgs; { devShells.default = mkShell { - # 👇 we can just use `rustToolchain` here: - buildInputs = [ - rustToolchain - openssl - ]; + nativeBuildInputs = [ rustToolchain pkg-config ]; + + buildInputs = [ openssl ]; + }; + + packages.default = rustPlatform.buildRustPackage { + inherit src pname version; + + cargoLock = { + lockFile = ./Cargo.lock; + }; + + nativeBuildInputs = [ rustToolchain pkg-config ]; + + buildInputs = [ openssl ]; }; } );