nix-eval-jobs/flake.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

2020-11-29 14:33:55 +00:00
{
description = "Hydra's builtin hydra-eval-jobs as a standalone";
2022-04-18 12:31:47 +00:00
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2020-11-29 14:33:55 +00:00
inputs.flake-utils.url = "github:numtide/flake-utils";
2022-05-09 07:20:56 +00:00
outputs =
{ self
, nixpkgs
, flake-utils
}:
flake-utils.lib.eachDefaultSystem (
system:
let
2022-05-09 07:20:56 +00:00
nixVersion = nixpkgs.lib.fileContents ./.nix-version;
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) stdenv;
2022-05-09 07:20:56 +00:00
devShell = self.devShells.${system}.default;
drvArgs = {
srcDir = self;
nix = if nixVersion == "unstable" then pkgs.nixUnstable else pkgs.nixVersions."nix_${nixVersion}";
};
in
2022-05-09 07:20:56 +00:00
{
packages.nix-eval-jobs = pkgs.callPackage ./default.nix drvArgs;
2021-08-25 17:50:06 +00:00
2022-05-09 07:20:56 +00:00
checks.treefmt = stdenv.mkDerivation {
name = "treefmt-check";
src = self;
nativeBuildInputs = devShell.nativeBuildInputs;
dontConfigure = true;
2022-05-09 07:20:56 +00:00
inherit (devShell) NODE_PATH;
2022-04-26 09:34:51 +00:00
2022-05-09 07:20:56 +00:00
buildPhase = ''
env HOME=$(mktemp -d) treefmt --fail-on-change
'';
2022-04-26 09:34:51 +00:00
2022-05-09 07:20:56 +00:00
installPhase = "touch $out";
};
2021-08-25 17:50:06 +00:00
packages.default = self.packages.${system}.nix-eval-jobs;
devShells.default = pkgs.callPackage ./shell.nix drvArgs;
2021-09-25 03:17:06 +00:00
}
);
2020-11-29 14:33:55 +00:00
}