From 8c12677824e84a7ecee4fcc1b8bb57c57c412f28 Mon Sep 17 00:00:00 2001 From: Slendi Date: Sat, 28 Mar 2026 02:38:19 +0200 Subject: [PATCH] Package for nix Signed-off-by: Slendi --- flake.nix | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 689134e..9517d35 100644 --- a/flake.nix +++ b/flake.nix @@ -48,18 +48,48 @@ inherit system; overlays = [ overlay ]; }; + + commonBuildInputs = with pkgs; [ + openssl + ]; + + commonNativeBuildInputs = with pkgs; [ + pkg-config + ]; + + singerPackage = pkgs.rustPlatform.buildRustPackage { + pname = "singer"; + version = "0.1.0"; + + src = pkgs.lib.cleanSource ./.; + + cargoLock.lockFile = ./Cargo.lock; + + nativeBuildInputs = commonNativeBuildInputs; + buildInputs = commonBuildInputs; + }; in { + packages = { + singer = singerPackage; + default = singerPackage; + }; + + apps.default = { + type = "app"; + program = "${singerPackage}/bin/singer"; + }; + devShells.default = pkgs.mkShell { - packages = with pkgs; [ - rustToolchain - openssl - pkg-config - cargo-deny - cargo-edit - cargo-watch - rust-analyzer - ]; + packages = (with pkgs; [ + rustToolchain + cargo-deny + cargo-edit + cargo-watch + rust-analyzer + ]) + ++ commonBuildInputs + ++ commonNativeBuildInputs; shellHook = '' export RUST_SRC_PATH="${pkgs.rustToolchain}/lib/rustlib/src/rust/library"