-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nix flake build and check this on CI (#145)
Broken by #144, which made dependencies incompatible with the pinned rust toolchain. This PR will check Nix Flake build on CI, but won't block PR merges if the check fails.
- Loading branch information
Showing
3 changed files
with
72 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,54 @@ | ||
{ | ||
description = "Protofetch - A source dependency management tool for Protobuf files"; | ||
description = "Protofetch - A source dependency management tool for Protobuf files"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
crane = { url = "github:ipetkov/crane"; inputs.nixpkgs.follows = "nixpkgs"; }; | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
crane = { | ||
url = "github:ipetkov/crane"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, crane }: flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
outputs = | ||
{ | ||
self, | ||
nixpkgs, | ||
flake-utils, | ||
crane, | ||
}: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
inherit (pkgs) lib; | ||
craneLib = crane.lib.${system}; | ||
in { | ||
craneLib = crane.mkLib pkgs; | ||
|
||
protofetch = craneLib.buildPackage { | ||
pname = "protofetch"; | ||
src = lib.cleanSourceWith { | ||
src = ./.; # The original, unfiltered source | ||
filter = path: type: (lib.hasSuffix "\.proto" path) || (craneLib.filterCargoSources path type); | ||
}; | ||
buildInputs = [ | ||
pkgs.openssl | ||
pkgs.libgit2 | ||
pkgs.pkg-config | ||
] ++ lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security ]; | ||
preBuild = '' | ||
export HOME=$(mktemp -d) | ||
''; | ||
}; | ||
in | ||
{ | ||
packages = rec { | ||
default = protofetch; | ||
protofetch = craneLib.buildPackage { | ||
pname = "protofetch"; | ||
src = lib.cleanSourceWith { | ||
src = ./.; # The original, unfiltered source | ||
filter = path: type: | ||
(lib.hasSuffix "\.proto" path) || | ||
(craneLib.filterCargoSources path type); | ||
}; | ||
buildInputs = with pkgs; [ | ||
openssl | ||
libgit2 | ||
pkg-config | ||
] ++ (if stdenv.isDarwin then [darwin.apple_sdk.frameworks.Security] else []); | ||
preBuild = '' | ||
export HOME=$(mktemp -d) | ||
''; | ||
}; | ||
inherit protofetch; | ||
default = protofetch; | ||
}; | ||
}); | ||
checks = { | ||
# Build the crate as part of `nix flake check` | ||
inherit protofetch; | ||
}; | ||
} | ||
); | ||
} | ||
|
||
|
||
|
||
|