Move hydra.nix to default.nix

So it's easier to use as a classic (non-flake) Nix expression.
This commit is contained in:
adisbladis 2021-09-24 22:02:34 -05:00
parent 2a382fe9f5
commit 7550bb8cc1
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
3 changed files with 38 additions and 39 deletions

View file

@ -1,2 +1,37 @@
{ pkgs ? import <nixpkgs> {} }:
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;
};
}

View file

@ -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;
};

View file

@ -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;
};
}