summaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix43
1 files changed, 32 insertions, 11 deletions
diff --git a/flake.nix b/flake.nix
index 9d579b9..5ba87db 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,20 +1,41 @@
{
- name = "patchelf";
-
description = "A tool for modifying ELF executables and libraries";
- requires = [ "nixpkgs" ];
+ inputs.nixpkgs.url = "nixpkgs/nixos-20.03";
- provides = deps: rec {
+ outputs = { self, nixpkgs }:
- hydraJobs = import ./release.nix {
- patchelfSrc = deps.self;
- nixpkgs = deps.nixpkgs;
- };
+ let
+ supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
+ forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
+ in
+
+ rec {
+
+ overlay = final: prev: {
- packages.patchelf = hydraJobs.build.x86_64-linux;
+ patchelf-new = final.stdenv.mkDerivation {
+ name = "patchelf-${hydraJobs.tarball.version}";
+ src = "${hydraJobs.tarball}/tarballs/*.tar.bz2";
+ };
- defaultPackage = packages.patchelf;
+ };
- };
+ hydraJobs = import ./release.nix {
+ patchelfSrc = self;
+ nixpkgs = nixpkgs;
+ };
+
+ checks = forAllSystems (system: {
+ build = hydraJobs.build.${system};
+ });
+
+ defaultPackage = forAllSystems (system:
+ (import nixpkgs {
+ inherit system;
+ overlays = [ self.overlay ];
+ }).patchelf-new
+ );
+
+ };
}