nix-eval-jobs/flake.nix

55 lines
1.7 KiB
Nix
Raw Normal View History

2020-11-29 14:33:55 +00:00
{
description = "Hydra's builtin hydra-eval-jobs as a standalone";
2023-01-18 15:38:32 +00:00
inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
2023-01-02 10:19:32 +00:00
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
2020-11-29 14:33:55 +00:00
2023-01-02 10:31:28 +00:00
nixConfig.extra-substituters = [
"https://cache.garnix.io"
];
nixConfig.extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
2023-01-02 10:19:32 +00:00
outputs = inputs @ { flake-parts, ... }:
let
inherit (inputs.nixpkgs) lib;
inherit (inputs) self;
nixVersion = lib.fileContents ./.nix-version;
in
flake-parts.lib.mkFlake { inherit inputs; }
2022-05-09 07:20:56 +00:00
{
2023-01-02 10:19:32 +00:00
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem = { pkgs, self', ... }:
let
devShell = self'.devShells.default;
drvArgs = {
srcDir = self;
nix = if nixVersion == "unstable" then pkgs.nixUnstable else pkgs.nixVersions."nix_${nixVersion}";
};
in
{
packages.nix-eval-jobs = pkgs.callPackage ./default.nix drvArgs;
2021-08-25 17:50:06 +00:00
2023-01-02 10:19:32 +00:00
checks.treefmt = pkgs.stdenv.mkDerivation {
name = "treefmt-check";
src = self;
nativeBuildInputs = devShell.nativeBuildInputs;
dontConfigure = true;
2023-01-02 10:19:32 +00:00
inherit (devShell) NODE_PATH;
2022-04-26 09:34:51 +00:00
2023-01-02 10:19:32 +00:00
buildPhase = ''
env HOME=$(mktemp -d) treefmt --fail-on-change
'';
2022-04-26 09:34:51 +00:00
2023-01-02 10:19:32 +00:00
installPhase = "touch $out";
};
2021-08-25 17:50:06 +00:00
2023-01-02 10:19:32 +00:00
packages.default = self'.packages.nix-eval-jobs;
devShells.default = pkgs.callPackage ./shell.nix drvArgs;
};
};
2020-11-29 14:33:55 +00:00
}