From 7550bb8cc12b734501a0908a820d34ae65edba15 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 24 Sep 2021 22:02:34 -0500 Subject: [PATCH] Move hydra.nix to default.nix So it's easier to use as a classic (non-flake) Nix expression. --- default.nix | 39 +++++++++++++++++++++++++++++++++++++-- flake.nix | 2 +- hydra.nix | 36 ------------------------------------ 3 files changed, 38 insertions(+), 39 deletions(-) delete mode 100644 hydra.nix diff --git a/default.nix b/default.nix index b2286a6..811bdc7 100644 --- a/default.nix +++ b/default.nix @@ -1,2 +1,37 @@ -{ pkgs ? import {} }: -pkgs.callPackage ./hydra.nix {} +{ stdenv +, lib +, nixFlakes +, meson +, cmake +, ninja +, pkg-config +, boost +, nlohmann_json +, srcDir ? null +}: + +let + filterMesonBuild = dir: builtins.filterSource + (path: type: type != "directory" || baseNameOf path != "build") dir; +in +stdenv.mkDerivation rec { + pname = "nix-eval-jobs"; + version = "0.0.1"; + src = if srcDir == null then filterMesonBuild ./. else srcDir; + buildInputs = [ + nlohmann_json nixFlakes boost + ]; + nativeBuildInputs = [ + meson pkg-config ninja + # nlohmann_json can be only discovered via cmake files + cmake + ]; + + meta = { + description = "Hydra's builtin hydra-eval-jobs as a standalone"; + homepage = "https://github.com/nix-community/nix-eval-jobs"; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ adisbladis mic92 ]; + platforms = lib.platforms.unix; + }; +} diff --git a/flake.nix b/flake.nix index b58e506..8c290d8 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ pkgs = nixpkgs.legacyPackages.${system}; in rec { - packages.nix-eval-jobs = pkgs.callPackage ./hydra.nix { + packages.nix-eval-jobs = pkgs.callPackage ./default.nix { srcDir = self; }; diff --git a/hydra.nix b/hydra.nix deleted file mode 100644 index cd5af6e..0000000 --- a/hydra.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ stdenv -, lib -, nixFlakes -, meson -, cmake -, ninja -, pkg-config -, boost -, nlohmann_json -, srcDir ? null -}: - -let - filterMesonBuild = dir: builtins.filterSource - (path: type: type != "directory" || baseNameOf path != "build") dir; -in -stdenv.mkDerivation rec { - pname = "nix-eval-jobs"; - version = "0.0.1"; - src = if srcDir == null then filterMesonBuild ./. else srcDir; - buildInputs = [ - nlohmann_json nixFlakes boost - ]; - nativeBuildInputs = [ - meson pkg-config ninja - # nlohmann_json can be only discovered via cmake files - cmake - ]; - meta = with lib; { - description = "Hydra's builtin hydra-eval-jobs as a standalone"; - homepage = "https://github.com/nix-community/nix-eval-jobs"; - license = licenses.gpl3; - maintainers = with maintainers; [ mic92 ]; - platforms = platforms.unix; - }; -}