forked from lix-project/nix-eval-jobs
Add nixpkgs-fmt + associated checks
This commit is contained in:
parent
9030f0f8c5
commit
0d3e7c2240
11
default.nix
11
default.nix
|
@ -12,17 +12,22 @@
|
|||
|
||||
let
|
||||
filterMesonBuild = dir: builtins.filterSource
|
||||
(path: type: type != "directory" || baseNameOf path != "build") dir;
|
||||
(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
|
||||
nlohmann_json
|
||||
nixFlakes
|
||||
boost
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
meson pkg-config ninja
|
||||
meson
|
||||
pkg-config
|
||||
ninja
|
||||
# nlohmann_json can be only discovered via cmake files
|
||||
cmake
|
||||
];
|
||||
|
|
16
flake.nix
16
flake.nix
|
@ -15,7 +15,8 @@
|
|||
|
||||
checks = {
|
||||
|
||||
editorconfig = pkgs.runCommand "editorconfig-checks" {
|
||||
editorconfig = pkgs.runCommand "editorconfig-check"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
pkgs.editorconfig-checker
|
||||
];
|
||||
|
@ -24,6 +25,16 @@
|
|||
touch $out
|
||||
'';
|
||||
|
||||
nixpkgs-fmt = pkgs.runCommand "fmt-check"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
pkgs.nixpkgs-fmt
|
||||
];
|
||||
} ''
|
||||
nixpkgs-fmt --check .
|
||||
touch $out
|
||||
'';
|
||||
|
||||
build = packages.nix-eval-jobs;
|
||||
|
||||
};
|
||||
|
@ -31,5 +42,6 @@
|
|||
defaultPackage = self.packages.${system}.nix-eval-jobs;
|
||||
devShell = pkgs.callPackage ./shell.nix drvArgs;
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,13 +2,15 @@
|
|||
, srcDir ? null
|
||||
}:
|
||||
|
||||
(pkgs.callPackage ./default.nix { inherit srcDir; }).overrideAttrs(old: {
|
||||
(pkgs.callPackage ./default.nix { inherit srcDir; }).overrideAttrs (old: {
|
||||
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [
|
||||
|
||||
pkgs.editorconfig-checker
|
||||
|
||||
(pkgs.python3.withPackages(ps: [
|
||||
pkgs.nixpkgs-fmt
|
||||
|
||||
(pkgs.python3.withPackages (ps: [
|
||||
ps.pytest
|
||||
]))
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
let
|
||||
pkgs = import (builtins.getFlake (toString ./.)).inputs.nixpkgs {};
|
||||
pkgs = import (builtins.getFlake (toString ./.)).inputs.nixpkgs { };
|
||||
in
|
||||
{
|
||||
builtJob = pkgs.writeText "job1" "job1";
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
|
||||
outputs = { self, nixpkgs }: let
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
in {
|
||||
in
|
||||
{
|
||||
hydraJobs = {
|
||||
builtJob = pkgs.writeText "job1" "job1";
|
||||
substitutedJob = pkgs.hello;
|
||||
|
|
Loading…
Reference in a new issue