From 705adbb8e4c215724b9a33ca3cdecf6db10107cc Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Thu, 14 Nov 2024 19:04:07 +0100 Subject: [PATCH] feat: add an overlay output Signed-off-by: Raito Bezarius --- default.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/default.nix b/default.nix index c437980..6af70ae 100644 --- a/default.nix +++ b/default.nix @@ -1,5 +1,41 @@ { sources ? import ./npins, pkgs ? import sources.nixpkgs {} }: { + overlay = self: super: + let + inherit (super) lib; + in + { + ofborg = super.rustPlatform.buildRustPackage { + name = "ofborg"; + src = super.nix-gitignore.gitignoreSource [ ] ./.; + + nativeBuildInputs = with pkgs; [ + pkg-config + rustPackages.clippy + ]; + + buildInputs = lib.optionals super.stdenv.isDarwin (with pkgs; [ + darwin.apple_sdk.frameworks.Security + darwin.apple_sdk.frameworks.CoreFoundation + ]); + + preBuild = '' + cargo clippy + ''; + + doCheck = false; # Tests require access to a /nix/ and a nix daemon + checkInputs = with super; [ + lix + ]; + + cargoLock = { + lockFile = ./Cargo.lock; + outputHashes = { + "hubcaps-0.6.2" = "sha256-yyHOCxUsehvtYfttRY4T9TDrJhSKGpJRa/SX3Sd1TNc="; + }; + }; + }; + }; packages = { ofborg = pkgs.rustPlatform.buildRustPackage { name = "ofborg";